You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Steven Woody <na...@HotPop.com> on 2003/10/31 03:57:37 UTC

attribut vs name in action definition

Hi,

In the MailReader examples's struts-config.xml, I noticed there are two different config mthod to associate a ActionForm to a Action.  One use attribute,

    <action    path="/editSubscription"
          ...
          attribute="subscriptionForm"
          ...
    </action>

others use  'name',

    <action    path="/logon"
               ...
               name="logonForm"
               ...
    </action>

What is the difference?


And, Struts-1.1 come with a JavaDoc for classes, but I did not find a reference manual for configuration files.  Is there anyone?


Regards.
--
Steven Woody
steven@lczmsoft.com

Re: attribut vs name in action definition

Posted by "Craig R. McClanahan" <cr...@apache.org>.
Steven Woody wrote:

>Hi,
>
>In the MailReader examples's struts-config.xml, I noticed there are two different config mthod to associate a ActionForm to a Action.  One use attribute,
>
>    <action    path="/editSubscription"
>          ...
>          attribute="subscriptionForm"
>          ...
>    </action>
>
>others use  'name',
>
>    <action    path="/logon"
>               ...
>               name="logonForm"
>               ...
>    </action>
>
>What is the difference?
>
>
>And, Struts-1.1 come with a JavaDoc for classes, but I did not find a reference manual for configuration files.  Is there anyone?
>
>  
>

Thanks for looking for the docs -- it always makes me feel better when 
people at least *try* to look up the answers for themselves :-).  The 
"reference manual" for the configuration files is the comments in the 
DTD itself.  Open "lib/struts-config_1_1.dtd" in your favorite text 
editor, and you'll see the information about all the available elements 
and attributes.

That includes the fact that form beans are normally stored as a request 
or session scope attribute under a key equal to the form name.  If you 
want to reuse a particular <form> element, but store the actual form 
bean instance under different request scope or session scope keys, 
that's what the "attribute" attribute is for.

>Regards.
>--
>Steven Woody
>steven@lczmsoft.com
>  
>
Craig



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org