Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-2903

MappingDispatchAction throws an error when mapping.getParameter returns null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.9
    • 1.3.6
    • Extras
    • None
    • Windows/Tomcat

    Description

      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!!)

      Attachments

        1. MappingDispatchAction.patch.txt
          3 kB
          George Jempty

        Activity

          People

            niallp Niall Pemberton
            jemptymethod George Jempty
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: