This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum 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
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply 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: 26496
    
  78

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: 56538
    
  14

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


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Locale wise 301 redirect in jsp
 
Similar Threads
how to change a date in desired format
AbstractMethodError
JSF and Locale
Struts2 can not change locale
ResourceBundle not using Locale