I am a little uneasy with folks directly accessing attributes that are used
internally by Struts especially since Struts gives you several methods in
the Action class that gives you exactly the same such as
getResources(request), getServlet(), getLocale(request) etc. Calling these
methods as opposed to getting the session attributes directly adds a layer
of abstraction between your code and the Struts implementation and makes
your code less vulnerable to any changes in the Struts implementation. Just
my 2 cents.
----- Original Message -----
From: "David Graham" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 20, 2003 4:22 PM
Subject: Re: can't get messages from my action
> Try:
>
> MessageResources messages = (MessageResources)
> servletContext.getAttribute(Action.MESSAGES_KEY);
>
>
> David
>
>
>
> >From: Garth Ramakant Patil <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: can't get messages from my action
> >Date: Mon, 20 Jan 2003 13:56:13 -0800 (PST)
> >
> >I'm trying to get a message from ApplicationResources.properties inside
> >one of my action perform methods. Here's what I try to do:
> >
> >MessageResources messages =
> >MessageResources.getMessageResources(Action.MESSAGES_KEY);
> >String modules = messages.getMessage("client.newuser");
> >
> >When I run it, modules comes up null. What am I doing wrong?
> >Thanks.
> >
> >
> >
> >--
> >To unsubscribe, e-mail:
> ><mailto:[EMAIL PROTECTED]>
> >For additional commands, e-mail:
> ><mailto:[EMAIL PROTECTED]>
>
>
> _________________________________________________________________
> The new MSN 8 is here: Try it free* for 2 months
> http://join.msn.com/?page=dept/dialup
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.435 / Virus Database: 244 - Release Date: 12/30/2002
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>