struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon.Ridgway" <Jon.Ridg...@upco.co.uk>
Subject RE: How to set locale using j_security_check
Date Fri, 06 Sep 2002 15:06:48 GMT
Hi Mike,

By default the user's locale will be set to that specified by their browser.
If you want to give users the option of changing their locale you would have
to display supported locales on a form (drop down, graphics etc) let the
user pick a locale and post to an action then as you have already spotted
use the setLocale method on the Action class to set the users locale to that
specified.

There may be a way - using LDAP and/or RDBMS and/or custom realms in WLS to
set the locale to a value specified in the realm for the user; not sure off
the top of my head - never seen one - but I'll have a look into it for
you...

If you really wanted to do this the easiest way would be to forward to an
Action in your secured area (to initiate FORM based auth), say
domain.com/secure/main.do and have the action get their locale from
persistent store and set it before forwarding onto the
domain.com/secure/main.jsp.

Jon Ridgway


-----Original Message-----
From: Michael Lee [mailto:mleejr@hotmail.com] 
Sent: 06 September 2002 14:56
To: Struts Users Mailing List
Subject: How to set locale using j_security_check

I use container managed security in WLS using j_security_check. I have
multiple languages. I want to load a user object with a locale and set it
for that user as long as he is logged in (Action.setLocale(request,
locale)??).
How would I do this if the container is handling log in for me? For example
lets say I want to go to 
domain.com/main.jsp but first it sends me to domain.com/login.html. The
container would then authenticate and send me to main.jsp. I want to
intercept this return and log in the user and set the local so he can see
his language ApplicationResources.properties.
Any hints? (I know this group has em! This is the best damn email group in
the world, I swear)
thanks,
Mike


The contents of this email are intended only for the named addressees and
may contain confidential and/or privileged material. If received in error
please contact UPCO on +44 (0) 113 201 0600 and then delete the entire
e-mail from your system. Unauthorised review, distribution, disclosure or
other use of this information could constitute a breach of confidence. Your
co-operation in this matter is greatly appreciated. 

--
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