[ 
http://issues.apache.org/struts/browse/STR-2903?page=comments#action_37663 ] 

George Jempty commented on STR-2903:
------------------------------------

Hey Niall, note that unspecified() is implemented slightly differently in the 
two classes: they call different keys from the resource bundle.

The REAL issue is that MappingDispatchAction's execute() delegates to 
DispatchAction's execute, thereby effectively hiding any overriding of 
getParameter()....the super class will use its own getParameter().  Overriding 
getParameter() is the right approach, but MappingDispatchAction's overriding of 
execute() would need to be entirely removed.

Therefore I think I'm just going to override execute() in my BaseAction that 
extends MappingDispatchAction with my own patch.  If MappingDispatchAction 
didn't override execute(), you're patch would be ideal.  Since that is not the 
case and I would need to modify execute() anyway, probably with a straight 
cut-and-paste from DispatchAction, and then also override getParameter(), I 
will just use my patch, without necessity to additionally override 
getParameter().

Thanks for all your consideration, as far as I'm concerned this issue can be 
closed.

> MappingDispatchAction throws an error when mapping.getParameter returns null
> ----------------------------------------------------------------------------
>
>          Key: STR-2903
>          URL: http://issues.apache.org/struts/browse/STR-2903
>      Project: Struts 1
>         Type: Bug

>     Versions: 1.2.9
>  Environment: Windows/Tomcat
>     Reporter: George Jempty
>  Attachments: MappingDispatchAction.patch.txt
>
> The JavaDoc for MappingDispatchAction states that unspecified() is the 
> "method which is dispatched to when there is no value for the parameter in 
> the ActionMapping."  When I don't specify "parameter" in the ActionMapping 
> however, I get the following stack trace:
> ERROR [http-8080-Processor24] (BaseCCAction.java:66) - 
> DispatchMapping[/msalogin] does not define a handler property
> javax.servlet.ServletException: DispatchMapping[/msalogin] does not define a 
> handler property
>       at 
> org.apache.struts.actions.DispatchAction.getParameter(DispatchAction.java:325)
>       at 
> org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
>       at 
> org.apache.struts.actions.MappingDispatchAction.execute(MappingDispatchAction.java:169)
>       at 
> com.cypresscare.web.common.actions.BaseCCAction.execute(BaseCCAction.java:60)
>       at 
> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
> My investigation shows that this is due to MappingDispatchAction's execute() 
> method doing nothing except delegating to DispatchAction's execute() method:
>       public ActionForward execute(
>               ActionMapping mapping,
>               ActionForm form,
>               HttpServletRequest request,
>               HttpServletResponse response)
>               throws Exception {
>         
>         // Use the overridden getMethodName. 
>         return super.execute(mapping, form, request, response);
>       }
> Furthermore, as evident from my attached stack trace, it is the overridden 
> getParameter() that actually needs to be used
> HTH
> George Jempty (ps my manager is Chuck Cavaness!!)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to