7

I am new to struts. I am wondering what input variable here signifies. After some googling, the only conclusive piece of info was this:

Input: The physical page (or another ActionMapping) to which control should be forwarded when validation errors exist in the form bean.

Is there any other use for the input parameter besides the case of an error occurring?

<action
   roles="somerole"
   path="some/path"
   type="some.java.class"
   name="somename"
   input="someInput"
   scope="request"
   validate="false"
   parameter="action">
   <forward name="success" path="some/path"/>
   <forward name="download" path="/another/path"/>
</action>
well actually
  • 11,810
  • 19
  • 52
  • 70
  • The only time your page is going to get forwarded to the jsp defined under _input_ when there is a validation error in the form `somename`. So you are correct in your understanding of the _input_ attribute here. – CoolBeans Dec 10 '11 at 01:29

1 Answers1

8

Yes, although you're correct that it's primarily a forward for failed validation.

The input has a dedicated method to return it: ActionMapping.getInputForward(). This can be used in custom (Java-based) validation to return to the input page.

It can also be used to identify a "landing" page: an action base class or custom request processor might send GET requests to the input forward, and process POSTs normally.

Dave Newton
  • 158,873
  • 26
  • 254
  • 302