On Wed, 11 Jul 2001, gdelgado wrote:

> On the struts-config.xml file:
> 1)Can someone give me a description of the use of the 'input' attribute
> under an action tag.
> 

The documentation is in the DTD itself.  Basically, this attribute defines
where Struts will return control to if the validate() method returns an
error.


> 2)How can I handle the fact that the input may come from two different JPSs
> (either one or the other).
> 

Then you'll want to *not* use the standard mechanism of return a set of
errors from your validate() method.  Instead, have the validate() method
store its errors in a request attribute, and let the action itself figure
out where to return control to.

At first glance, it is tempting to think of using the "Referer" header for
this purpose.  However, in a Struts-based application, this header will
not be particularly useful -- because it only records the *browser's*
notion of what the submitting page was.  Because the browser doesn't know
about any of the RequestDispatcher.forward() calls occurring on the server
side, this will almost always be the URL of the last action that was
executed, not the JSP page that was submitted.

To get around this, I would suggest using a hidden form variable in your
pages, so that the action can tell them apart.

Craig McClanahan

Reply via email to