This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes Servlets and the fly likes getCharacterEncoding / getLocale Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "getCharacterEncoding / getLocale" Watch "getCharacterEncoding / getLocale" New topic
Author

getCharacterEncoding / getLocale

Siamak Saarmann
Ranch Hand

Joined: Aug 21, 2004
Posts: 78
Hello,

I have problem with above methods. I appereciate your help.

1- I have a problem with getCharacterEncoding.

If I do not use setCharacterEncoding I always get "null" from getCharacterEncoding.

2- If I setLocale on reponse or request I get desired locale if I use getLocale. But if I do not setLocale and just want to see what Locale is set on user's browser, I always get en_US.

Are above things normal?

Regards,
Mac


PhD Artificial Intelligence, OCJP1.6
leon fan
Greenhorn

Joined: Aug 02, 2004
Posts: 19
Did you set other language rather than english as prefer language in your browser when you try to access your jsp by browser?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17275
    
    6

"Siamak"-
Welcome to the JavaRanch! Please adjust your displayed name to meet the

JavaRanch Naming Policy.

You can change it

here.

Thanks! and welcome to the JavaRanch!

Mark


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
 
 
subject: getCharacterEncoding / getLocale
 
It's not a secret anymore!