You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Luca Boncompagni (JIRA)" <ji...@apache.org> on 2007/04/11 10:29:51 UTC

[jira] Created: (STR-3029) ActionConfigMatcher does not instantiate the correct ActionForward

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.


[jira] Commented: (STR-3029) ActionConfigMatcher does not instantiate the correct ActionForward

Posted by "Luca Boncompagni (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/STR-3029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40822 ] 

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

I tried the above code and it seems to work.

Regards,
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.


[jira] Closed: (STR-3029) ActionConfigMatcher does not instantiate the correct ActionForward

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/STR-3029?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed STR-3029.
------------------------------

    Resolution: Fixed

Marking as fixed.

> 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
>             Fix For: 1.3.9, 1.4.0
>
>
> 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.


[jira] Updated: (STR-3029) ActionConfigMatcher does not instantiate the correct ActionForward

Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/STR-3029?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Benedict updated STR-3029:
-------------------------------

    Fix Version/s: 1.4.0
                   1.3.9

Please try 1.3.9-SNAPSHOT out and tell me if this works for you.

> 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
>             Fix For: 1.3.9, 1.4.0
>
>
> 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.


[jira] Commented: (STR-3029) ActionConfigMatcher does not instantiate the correct ActionForward

Posted by "Luca Boncompagni (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/STR-3029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40832 ] 

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

I commented it out because they are not changede by convertParam().

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.


[jira] Commented: (STR-3029) ActionConfigMatcher does not instantiate the correct ActionForward

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/STR-3029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40774 ] 

Niall Pemberton commented on STR-3029:
--------------------------------------

I agree with your assesment of the issue - but IMO the solution would be to use BeanUtils.cloneBean() rather than the newInstance() method - otherwise additional properties in the custom ActionForward implementation (presumably the reason for having a custom impl) would not be copied.

> 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.


[jira] Commented: (STR-3029) ActionConfigMatcher does not instantiate the correct ActionForward

Posted by "Luca Boncompagni (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (STR-3029) ActionConfigMatcher does not instantiate the correct ActionForward

Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/STR-3029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40828 ] 

Paul Benedict commented on STR-3029:
------------------------------------

Does that mean that upgrading to 1.3.8 fixes your problem?

> 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.


[jira] Commented: (STR-3029) ActionConfigMatcher does not instantiate the correct ActionForward

Posted by "Luca Boncompagni (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/STR-3029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40925 ] 

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

Yes it worked.

Thanks,
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
>             Fix For: 1.3.9, 1.4.0
>
>
> 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.


[jira] Commented: (STR-3029) ActionConfigMatcher does not instantiate the correct ActionForward

Posted by "Luca Boncompagni (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/STR-3029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40775 ] 

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

Hi, do you think that is posiible to have a patch for this issue, or are you
releasing 1.2.10 soon?

Thanks,
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.


[jira] Commented: (STR-3029) ActionConfigMatcher does not instantiate the correct ActionForward

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/STR-3029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40924 ] 

Henri Yandell commented on STR-3029:
------------------------------------

Did this work 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
>             Fix For: 1.3.9, 1.4.0
>
>
> 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.


[jira] Commented: (STR-3029) ActionConfigMatcher does not instantiate the correct ActionForward

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/STR-3029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40776 ] 

Niall Pemberton commented on STR-3029:
--------------------------------------

I doubt there will be a 1.2.10 release more likely to make the next 1.3.x or 1.4 release - whenever those may be

> 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.


[jira] Commented: (STR-3029) ActionConfigMatcher does not instantiate the correct ActionForward

Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/STR-3029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40830 ] 

Paul Benedict commented on STR-3029:
------------------------------------

Why is name and redirect commented out?

> 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.


[jira] Commented: (STR-3029) ActionConfigMatcher does not instantiate the correct ActionForward

Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/STR-3029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40779 ] 

Paul Benedict commented on STR-3029:
------------------------------------

Luca, please help us out by testing this against 1.3.8. if the problem still exists, and it's an easy fix, you may see it in 1.3.9 (or 1.4 if complex). Can you test to make sure it hasn't been fixed?

> 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.


[jira] Updated: (STR-3029) ActionConfigMatcher does not instantiate the correct ActionForward

Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/STR-3029?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Benedict updated STR-3029:
-------------------------------

    Fix Version/s:     (was: 1.4.0)

> 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
>             Fix For: 1.3.9
>
>
> 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.


[jira] Commented: (STR-3029) ActionConfigMatcher does not instantiate the correct ActionForward

Posted by "Luca Boncompagni (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/STR-3029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40829 ] 

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

no, I upgraded to 1.3.8 and I patched the ActionconfigMatcher to use
BeanUtils.cloneBean(fConfigs[x]), in this way everything works well. Here
you can find the patch:

--- ActionConfigMatcher.java    2007-03-03 09:44:10.000000000 +0100
+++ ActionConfigMatcher-new.java        2007-04-12 09:45:10.168689442 +0200
@@ -180,10 +180,17 @@
         ForwardConfig cfg;

         for (int x = 0; x < fConfigs.length; x++) {
-            cfg = new ActionForward();
-            cfg.setName(fConfigs[x].getName());
+           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.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));


regards,
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.