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

AnnotationValidationInterceptor should consult UnknownHandler before throwing NoSuchMethodException

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.14
    • Fix Version/s: 2.5.10
    • Component/s: None
    • Labels:
      None

      Description

      If a NoSuchMethodException is caught when invoking getActionMethod(), AnnotationValidationInterceptor should first give any configured UnknownHandler a shot, before throwing the exception directly, just as what DefaultActionInvocation.invokeAction() does.

      Any unknown Action or unknown Result is currently handled by Dispatcher.serviceAction(), and a 404 error code will be returned as expected. But an unknown Method will raise a 500 error, the only way to avoid this is to configure an UnknownHandler. Therefore, AnnotationValidationInterceptor won't inspect UnknownHandler at all...

      GET /foo/list  404 (Action "foo" not found)
      GET /bar/list  200
      GET /bar/print 500 (Method "print" not found, 404 is expected instead of 500)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lukaszlenart Lukasz Lenart
                Reporter:
                azuo_lee Azuo Lee
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: