This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes Locale wise 301 redirect in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Locale wise 301 redirect in jsp" Watch "Locale wise 301 redirect in jsp" New topic
Author

Locale wise 301 redirect in jsp

Nids Arora
Greenhorn

Joined: Mar 05, 2010
Posts: 3
I have a site which has many locales, with locale path as US/en, FR/fr, CH/de ,/DE/de etc. I want to have code like if the locale is FR/fr then user should be redirected to france site and if US/en then to english site. Please provide me the code for it. so i can redirect from my home page to the respective URL's.
Maximus Moothiringus
Ranch Hand

Joined: Jun 07, 2008
Posts: 46

Isn't this what Internationalization and localization is for?


-- Maximus Moothiringus
Preparing for SCJA!!
Finally figured out that giving <br/> splits the profile biography but not the signature
Nids Arora
Greenhorn

Joined: Mar 05, 2010
Posts: 3
Can you please provide me with the code.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30085
    
149

See this tutorial both for understand and sample code.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

In a JSP page you will use the services of the JSTL's fmt library of tags.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Nids Arora
Greenhorn

Joined: Mar 05, 2010
Posts: 3
Jeanee Thanks for your help!!
Maximus Moothiringus
Ranch Hand

Joined: Jun 07, 2008
Posts: 46

Great Tutorial Jeanne!!
The TOC and the really big index in that led me to some other tutorials which I never knew was there and which I very badly needed. Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Locale wise 301 redirect in jsp
 
Similar Threads
JSF and Locale
ResourceBundle not using Locale
Struts2 can not change locale
how to change a date in desired format
AbstractMethodError