You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Adam Gordon <ad...@readytalk.com> on 2008/05/29 23:13:55 UTC

Issue with ForwardAction when migrating from Struts 1.2.9 to 1.3.9

We've successfully migrated our web application from Struts 1.2.9 to 
1.3.9 except for one small issue with ForwardAction.  It appears that 
given the following action definition,

<action path="/Index"
        type="org.apache.struts.actions.ForwardAction"
        parameter="/reports/meeting/Index.do"/>

1.3.9 handles the parameter value differently than 1.2.9.  I've noticed 
that 1.3.9 is much more strict about making sure stuff complies with the 
stuff it's supposed to comply with so in that regard, perhaps there's an 
issue with specifying an action URI as a value of a parameter attribute 
in 1.3.9, but we don't know for sure.

Ultimately, the error we're getting is a Tomcat 404 for the original URL 
in 1.3.9 (and an invalid path Struts error in the logs) but not in 
1.2.9.  Our configuration in our web.xml hasn't changed w.r.t. module 
configuration or security constraints.  As a workaround, we've replaced 
ForwardAction with a custom action that simply does a 
response.sendRedirect(...) to the right URI.  It works, but I consider 
it a hack because it doesn't fix the root problem.

Any help would be appreciated.  Thanks.

-- adam

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Issue with ForwardAction when migrating from Struts 1.2.9 to 1.3.9

Posted by Adam Gordon <ad...@readytalk.com>.
Mark-

Thanks for your reply.  I neglected to mention that /reports was a 
module and /reports/meeting was a (separate) module.  The solution you 
mentioned didn't work verbatim, but reading the DTD section again the 
phrase 'module-secific' jumped out at me so we tried /meeting/Index.do 
as we were technically already in the /reports module and voila!  It worked.

Thanks for the nudge in the right direction.

-adam

Mark Shifman wrote:
> Hi:
> This doesn't completely answer your question but it should work.
> if you look at the dtd for struts-config_1_3.dtd
> http://struts.apache.org/1.3.8/struts-core/dtddoc/struts-config_1_3.dtd.html
> or
> http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/resources/org/apache/struts/resources/struts-config_1_3.dtd?view=markup
>
>> forward Module-relative path of the servlet or other resource that will process this request, 
> instead of the Action class specified by "type". The path WILL NOT be
> processed through the "forwardPattern"
> attribute that is configured on the "controller" element for this
> module. Exactly one of "forward", "include", or "type" must be specified.
>
> <action path="/Index"
>         forward="/reports/meeting/Index.do"/>
>
> Setting forward="/reports/meeting/Index.do" as an action attribute
> without any type should do what you want.
>
> mas
>
> Adam Gordon wrote:
>> We've successfully migrated our web application from Struts 1.2.9 to
>> 1.3.9 except for one small issue with ForwardAction.  It appears that
>> given the following action definition,
>>
>
>> 1.3.9 handles the parameter value differently than 1.2.9.  I've noticed
>> that 1.3.9 is much more strict about making sure stuff complies with the
>> stuff it's supposed to comply with so in that regard, perhaps there's an
>> issue with specifying an action URI as a value of a parameter attribute
>> in 1.3.9, but we don't know for sure.
>>
>> Ultimately, the error we're getting is a Tomcat 404 for the original URL
>> in 1.3.9 (and an invalid path Struts error in the logs) but not in
>> 1.2.9.  Our configuration in our web.xml hasn't changed w.r.t. module
>> configuration or security constraints.  As a workaround, we've replaced
>> ForwardAction with a custom action that simply does a
>> response.sendRedirect(...) to the right URI.  It works, but I consider
>> it a hack because it doesn't fix the root problem.
>>
>> Any help would be appreciated.  Thanks.
>>
>> -- adam
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Issue with ForwardAction when migrating from Struts 1.2.9 to 1.3.9

Posted by Mark Shifman <ma...@yale.edu>.
Hi:
This doesn't completely answer your question but it should work.
if you look at the dtd for struts-config_1_3.dtd
http://struts.apache.org/1.3.8/struts-core/dtddoc/struts-config_1_3.dtd.html
or
http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/resources/org/apache/struts/resources/struts-config_1_3.dtd?view=markup

> forward Module-relative path of the servlet or other resource that will process this request, 
instead of the Action class specified by "type". The path WILL NOT be
processed through the "forwardPattern"
attribute that is configured on the "controller" element for this
module. Exactly one of "forward", "include", or "type" must be specified.

<action path="/Index"
        forward="/reports/meeting/Index.do"/>

Setting forward="/reports/meeting/Index.do" as an action attribute
without any type should do what you want.

mas

Adam Gordon wrote:
> We've successfully migrated our web application from Struts 1.2.9 to
> 1.3.9 except for one small issue with ForwardAction.  It appears that
> given the following action definition,
> 

> 
> 1.3.9 handles the parameter value differently than 1.2.9.  I've noticed
> that 1.3.9 is much more strict about making sure stuff complies with the
> stuff it's supposed to comply with so in that regard, perhaps there's an
> issue with specifying an action URI as a value of a parameter attribute
> in 1.3.9, but we don't know for sure.
> 
> Ultimately, the error we're getting is a Tomcat 404 for the original URL
> in 1.3.9 (and an invalid path Struts error in the logs) but not in
> 1.2.9.  Our configuration in our web.xml hasn't changed w.r.t. module
> configuration or security constraints.  As a workaround, we've replaced
> ForwardAction with a custom action that simply does a
> response.sendRedirect(...) to the right URI.  It works, but I consider
> it a hack because it doesn't fix the root problem.
> 
> Any help would be appreciated.  Thanks.
> 
> -- adam
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shifman@yale.edu

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org