File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Setting encoding type of all the request parameters in a filter Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Setting encoding type of all the request parameters in a filter" Watch "Setting encoding type of all the request parameters in a filter" New topic
Author

Setting encoding type of all the request parameters in a filter

Sankha Ray
Greenhorn

Joined: May 01, 2010
Posts: 6
Hi,
Can you tell if it is possible to set the encoding type of all the request parameters in a filter.

The problem is that, i have created a j2ee project which deals with japanese characters.So,i need to use this
new String(value.getBytes("ISO-8859-1"), "UTF-8"); in my code whereever i am retrieving data from request objects
in order to display,update japanese values.Its a pain changing the code every here and there.

Can you comment on the possiblity of solving the issue with the help of filter?
A little hints on the approach will be enough.



sudhir nim
Ranch Hand

Joined: Aug 29, 2007
Posts: 212

I think request.setCharacterEncoding() might help you, but i am not sure.


[Servlet tutorial] [Servlet 3.0 Cook Book]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Setting encoding type of all the request parameters in a filter
 
Similar Threads
For all who have problems with encoding!!!
character encoding problem
Problem encoding japanese character
Exact Front Controller In Realtime
Chaining filter servlet