Hi James
it does not work that way , what i have done is the
following..
MessageResources mr =
MessageResources.getMessageResources("com.pfizer.maps.maps");
where "com.pfizer.maps.maps" is my properties file,
defined in web.xml, 
String message = mr.getMessage(locale, key);

This works fine when i have only one properties file
for english, can u test if this will work in
internaltiozation, say i have one more properties filr
"com.pfizer.maps.maps_fr",
will this same code work.
Ashish



--- James Mitchell <[EMAIL PROTECTED]> wrote:
> <Off-the-top-of-my-head/>
> If your servlet is running in the same web app as
> your struts app, (I think)
> you should be able to:
> 
> **warning - this is only from memory***
> 
>   MessageResources mr =
>
servletcontext.getAttribute("org.apache.struts.MESSAGE");
>   mr.getMessage("index.title");
> 
> 
> 
> James Mitchell
> Software Engineer\Struts Evangelist
> Struts-Atlanta, the "Open Minded Developer Network"
> http://www.open-tools.org/struts-atlanta
> 
> 
> 
> 
> > -----Original Message-----
> > From: Ashish Kulkarni
> [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, September 19, 2002 2:35 PM
> > To: Struts Users Mailing List
> > Subject: Getting Message from properties file in
> servlet
> >
> >
> > Hi,
> > If i have to get messages from properties file and
> > display them in jsp i use <bean:message
> > key="index.title"/>
> > tag to do so,
> > if i want to get this same message in my servlet
> how
> > can i do it, i want this message as String in
> servlet
> >
> > Ashish
> >
> > =====
> > A$HI$H
> >
> > __________________________________________________
> > Do you Yahoo!?
> > New DSL Internet Access from SBC & Yahoo!
> > http://sbc.yahoo.com
> >
> > --
> > 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]>
> 


=====
A$HI$H

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

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

Reply via email to