Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3368

ConventionUnknownHandler doesn't play nicely with rest plugin

    XMLWordPrintableJSON

Details

    Description

      ConventionUnknownHandler's handleUnknownActionMethod() always throws a NoSuchMethodException which does not play nicely with the REST plugin. The REST plugin will take urls such as /x/y/z and try and call a z() method on the action. If no such method exists, the desired behavior should be a 404 and not an error. My codebase has a second UnknownHandler implementation that takes care of the 404, but because the ConventionUnknownHandler throws an error rather than returning null, it never gets a chance to execute. The behavior that ConventionUnknownHandler should follow is to return null and allow any other registered handlers have a shot at dealing with the missing method. I have created a local patch with this change, and it works correctly.

      Attachments

        Activity

          People

            lukaszlenart Lukasz Lenart
            yosarian David Mc
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: