struts action mapping action input attribute

rabs picture rabs · Jul 11, 2011 · Viewed 48.4k times · Source

I am a noob when it comes to Java and Struts ( I feel like .Net boy in Java world ).

What is the input attribute on the action element used for? So in the example below the input is someinput.jsp.

<action path="/somepath" 
        type="SomeAction" 
        name="SomeForm" 
        scope="session"
        input="someinput.jsp">

Answer

Ken Chan picture Ken Chan · Jul 11, 2011

If the form bean SomeForm returns validation errors, it will return the page someinput.jsp. To quote the corresponding DTD:

Valid only when "name" is specified. Required if "name" is specified and the input bean returns validation errors. Optional if "name" is specified and the input bean does not return validation errors.