When you call request.getAttribute("application.attribute1"), you're using the
HttpServletRequest object. The attribute you are accessing is tied to the
request itself, not to the app or even the user's session. The request only has
a lifetime starting when the request for a page comes into the servlet engine
and is done when the servlet is done executing its doGet, doPost, or service
method. In the case of struts, it's actually when your ActionForm has completed
its process() method.

I don't know of too many uses for request attributes except for setting
request-scoped beans which are used by the JSP to build the display.

--- Michael Mehrle <[EMAIL PROTECTED]> wrote:
> Thanks for the quick update - I of course realize that this is a scope
> issue, but with the plethora of attributes and properties one can get
> confused with all that... I will try this as suggested.
> 
> One more question: Am I correct to assume that I could retrieve values from
> my ApplicationResources file also from within my form subclass by calling:
> 
> String myAttribute = request.getAttribute("application.attribute1"));
> 
> Cheers,
> 
> Michael
> 
> ----- Original Message -----
> From: "Mark Rines" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Sunday, January 27, 2002 8:49 AM
> Subject: Re: Can I directly access properties in my ApplicationResources
> file?
> 
> 
> > Scope, scope, scope. Once you're in your Action class, you are in the
> > business logic scope of your application. Your business logic should have
> > nothing to do with Struts, or any other non business related architectural
> > implementation ( such as Swing, JAAS, etc...), architecturally speaking.
> So,
> > use the classes and methods used for manipulating any other properties
> file,
> > which is just what the ApplicationResources.properties file is, no more,
> no
> > less. For more info see the Properties class , and the supporting classes
> > Property*. Reading can be as  easy as:
> > ...
> > PropertyResourceBundle p = new PropertyResourceBundle( new
> > FileInputStream("ApplicationResources.properties") );
> > ...
> > String propertyValue = p.getString("myKeyName");
> > ...
> >
> > Hope this helps.
> > Mark
> > ----- Original Message -----
> > From: "Michael Mehrle" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Sunday, January 27, 2002 12:01 AM
> > Subject: Can I directly access properties in my ApplicationResources file?
> >
> >
> > > Okay, I'm in my Action class and would like to access some application
> > > specific configuration settings stored in my ApplicationResources.config
> > > file . What method do I call from my Action subclass in order to get to
> > > those? I have been looking all over the place and can't make sense out
> of
> > > this...
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
> >
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 


__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to