On Tue, 13 Mar 2001, Neal Kaiser wrote:

> Does Struts store the client's Locale in their session somewhere? If so, how
> would
> I access it?
> 

Yes, it does.  Look for a java.util.Locale object stored as a session
attribute under key "org.apache.struts.action.LOCALE".  In a program, you
could use the symbolic string constant Action.LOCALE_KEY instead (from the
org.apache.struts.action.Action class).

Be sure that you enable Locale tracking if you want this to work, by
setting the appropriate initialization parameter for the controller
servlet (parameter "locale" should have a value of "true").  Also, if the
first request in your session is to a JSP page instead of the controller
servlet, you can have the page save the Locale by using tag:

        <html:html locale="true">
        ... contents of your page
        </html:html>

around it.

> I have a non-struts servlet which I want to try to pull the Locale object
> from.
> 
> Thanks,
> 
> Neal
> 
> 

Craig McClanahan


Reply via email to