struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Boudrant <>
Subject Re: struts-config.xml question
Date Tue, 01 Oct 2002 16:55:12 GMT

'name' is the name of the form used by the action, this name must exist in form-beans declaration.

'attribute' is the key where the form instance will be stored in your session/request scope
the action. by default attribute == name, but if you want, by setting 'attribute', you can
this key.

@see the struts-config DTD, there is a lot of comment foreach element/attribute.


 --- Kevin HaleBoyes <> a écrit : > I'm looking at the struts-example
and its
struts-config.xml file.
> In the <action> section for editRegistration, 'attribute' is set
> to 'registrationForm'.  As I understand it (from the DTD), attribute
> is the name of the scoped (session or request) attribute that is used
> to access the ActionForm bean.
> Now in the <action> section for saveRegistration 'name' is set
> to 'registrationForm'.  'name' is the name of the form bean that is
> associated with this mapping.
> What is the difference between 'attribute' and 'name'?
> It seems that they are the same thing.  Is this true?
> Looking at the source for the edit and save registration actions,
> they both call mapping.getAttribute() to get the name of the
> ActionForm bean.  Why does that work for the saveRegistration
> action when it doesn't even have an 'attribute' defined for its
> <action>?
> Why doesn't saveRegistration use 'attribute' instead of 'name'?
> Thanks,
> Kevin.
> __________________________________________________
> Do you Yahoo!?
> New DSL Internet Access from SBC & Yahoo!
> --
> To unsubscribe, e-mail:   <>
> For additional commands, e-mail: <>

Do You Yahoo!? -- Une adresse gratuite et en français !
Yahoo! Mail :

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message