struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard Miller" ...@howardmiller.co.uk>
Subject Re: ActionMapping.getAttribute()
Date Wed, 02 Oct 2002 05:45:47 GMT
Thanks Eddie,

That's interesting, *but* what does the attribute of an ActionMapping actually *mean*, 
why would I want to use it?

I think I've completely failed to understand some important concept! I don't see how a 
mapping has a concept of scope when it belongs to an Action, not a FormBean or 
similar.

Howard Miller

On 1 Oct 2002 at 16:54, Eddie Bush wrote:

> attribute is an ... attribute (bit confusing) of an ActionMapping.  The 
> getAttribute() method returns the value of the attribute attribute - or 
> the name attribute if the attribute attribute is null.  ActionMapping 
> actually inherits this from ActonConfig (in o.a.s.config) so the proper 
> javadoc for it (if it exist) would be found there.
> 
>     /**
>      * The request-scope or session-scope attribute name under which our
>      * form bean is accessed, if it is different from the form bean's
>      * specified <code>name</code>.
>      */
> 
> That's the javadoc comment for the attribute attribute - taken from 
> ActionConfig.java.  So the attribute attribute, then, specifies the name 
> under which we can find the form-bean associated with this action - 
> whether it is stored in request or session scope is specified by a 
> different attribute - scope.
> 
> Questions on this level can most easily be answered by consulting the 
> source :-)  Go checkout a copy from CVS (if you can) or grab a copy of 
> the latest source release (beta 2 - some of it has been updated, but for 
> questions such as this it's still valid I believe).  I wish they'd do 
> nightly source snapshots too ...
> 
> Howard Miller wrote:
> 
> >Hi,
> >
> >Confused again....
> >
> >short question.... what does the method ActionMapping.getAttribute() do?? The 
> >javadoc for it is a bit terse!
> >
> >Longer version... I'm working through the struts-example (carefully) this time, and
it 
> >keeps turning up - I simply can't see what its for. In particular in 
> >EditRegistrationAction.java it is used to store the RegistrationForm bean that is

> >created. Why is that done? I would have thought that is a bean is stored in the 
> >request or session scope it would just have a constant value - not this mystery value
- 
> >what am I missing?
> >
> >While on the subject, (and I suspect related) - what does ActionMapping.getScope()

> >do? I don't get how an Action can have a scope and/or an Attribute. What's the 
> >story??
> >
> >Howard Miller
> >
> 
> -- 
> Eddie Bush
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
> 
> 



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


Mime
View raw message