[ 
https://issues.apache.org/struts/browse/STR-3029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40780
 ] 

Luca Boncompagni commented on STR-3029:
---------------------------------------

Hi Paul,

I'll try to test 1.3.8 with the following code:

        ForwardConfig[] fConfigs = orig.findForwardConfigs();
        ForwardConfig cfg;

        for (int x = 0; x < fConfigs.length; x++) {
            try {
               cfg = (ActionForward) BeanUtils.cloneBean(fConfigs[x]);
            } catch (Exception ex) {
               log.warn("Unable to clone action forward, recommend not using
"
                   + "wildcards", ex);

               return null;
            }
            // cfg.setName(fConfigs[x].getName());
            cfg.setPath(convertParam(fConfigs[x].getPath(), vars));
            // cfg.setRedirect(fConfigs[x].getRedirect());
            cfg.setCommand(convertParam(fConfigs[x].getCommand(), vars));
            cfg.setCatalog(convertParam(fConfigs[x].getCatalog(), vars));
            cfg.setModule(convertParam(fConfigs[x].getModule(), vars));

I'll let you know how it run.

Luca



> ActionConfigMatcher does not instantiate the correct ActionForward
> ------------------------------------------------------------------
>
>                 Key: STR-3029
>                 URL: https://issues.apache.org/struts/browse/STR-3029
>             Project: Struts 1
>          Issue Type: Bug
>    Affects Versions: 1.2.9
>         Environment: Solaris WebSphere 5.1.1
>            Reporter: Luca Boncompagni
>
> 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());

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to