[ http://issues.apache.org/struts/browse/STR-2903?page=comments#action_38894 ] George Jempty commented on STR-2903: ------------------------------------
Thanks Niall. I indeed implemented this very suggestion of yours of overriding getParameter() in my own custom Action extending MappingDispatchAction, and what this allowed me to do was to use my existing struts config file with no modifications: I only had to add the parameter attribute to my mappings on an as needed basis. That is the sort of benefit to be gained, and it seems to be a very simple non-invasive code change. > MappingDispatchAction throws an error when mapping.getParameter returns null > ---------------------------------------------------------------------------- > > Key: STR-2903 > URL: http://issues.apache.org/struts/browse/STR-2903 > Project: Struts 1 > Issue Type: Bug > Components: Extras > Affects Versions: 1.2.9 > Environment: Windows/Tomcat > Reporter: George Jempty > Fix For: 1.3.6 > > 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
