Search code examples
javastruts2workflowstruts2-interceptors

Struts 2 workflow interceptor and actions that do not have an INPUT result


If I understand, the Struts 2 interceptor stack correctly, the workflow interceptor looks to see if any validation failures have been reported by the validation interceptor. If it finds that there have been validation failures, it returns ( by default ) Action.INPUT

If this is the case, what happens if the Action that is being executed does not have an INPUT result defined in its struts.xml configuration?


Solution

  • If it returns INPUT, and there is no result defined for that (and no general result), you'll get an error page that says something like

     No result defined for type INPUT and action <action name>.
    

    You can define a general page that will always be shown for 'INPUT', but the better solution is that if you have a validate() method, it's usually a good idea to define an INPUT result to go back. Even if you don't explicitly do any validation, things like a non-integer value being passed to an integer field can cause that result, so it's a good idea to define it.