struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: <action-mappings>
Date Wed, 04 Oct 2000 16:51:19 GMT
Larry Kim wrote:

> hi ,
> The action.xml file has a mysterious attribute called "inputForm".
> what is the meaning of this attribute?  I have put values in "inputForm" and
> deleted them, and my application seems to work the same with our without
> this attribute being present.

Ah, it is a little bit obtuse, isn't it?  :-)

One of the other attributes you set is formClass, which tells Struts the Java
class name of your form bean.  If your bean implements the ValidatingActionForm
interface (instead of just ActionForm), Struts does the following additional
processing before calling your action:

* Populates the form bean properties as usual

* Calls the validate() method of your form bean

* If there are any errors, redirects to the URL
  indicated by the inputForm attribute (which is
  normally the address where the form came from).

If your form bean does not implement ValidatingActionForm, there is no change in
behavior with or without the inputForm attribute.  But if it does, you've got an
easy mechanism for server-side validation of the input data, before bothering to
execute your action.

Craig McClanahan

See you at ApacheCon Europe <>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat

View raw message