struts-config.xml file - purpose of input
Asked Answered
F

1

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>
Firewater answered 10/12, 2011 at 0:10 Comment(1)
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.Paraclete
H
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.

Holomorphic answered 10/12, 2011 at 14:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.