Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-3029

ActionConfigMatcher does not instantiate the correct ActionForward

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.9
    • 1.3.9
    • None
    • None
    • Solaris WebSphere 5.1.1

    Description

      If you create an action config like this:

      <action path="/mf/**"
      type="it.test.pfwk.actions.MultiFrameAction">
      <forward name="success" className="it.test.framework.actions.WsActionForward" path="/luca.jsp"/>
      </action>

      When you do a mapping.findForward() you get an org.apache.struts.action.ActionForward instead of it.test.framework.actions.WsActionForward.

      I think that the problem is in ActionconfigMatcher, convertActionConfig():

      ForwardConfig[] fConfigs = orig.findForwardConfigs();
      ForwardConfig cfg;
      for (int x = 0; x < fConfigs.length; x++) {
      cfg = new ActionForward();
      cfg.setContextRelative(fConfigs[x].getContextRelative());

      Here you should instatiate the correct actionForrward, for instance, if you modifiy ActionForwrad in order to have a method like newInstance():

      ForwardConfig[] fConfigs = orig.findForwardConfigs();
      ForwardConfig cfg;
      for (int x = 0; x < fConfigs.length; x++) {
      cfg = fConfigs[x].newInstnce();
      cfg.setContextRelative(fConfigs[x].getContextRelative());

      Attachments

        Activity

          People

            Unassigned Unassigned
            lbonco Luca Boncompagni
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: