cancel
Showing results for 
Search instead for 
Did you mean: 

Request character encoding.

Former Member
0 Kudos

Hello.

I need to know how can I change the character encoding of request to other then default.

For example I want it be a "UTF-8", but the default is "US-ASCII".

I tried to change it via the "config tool" (Alone->services->http->Encoding), did a restart to a SAP_J2EE server, but when I look in the debugger the instance of HttpServletRequest still has it's

characterEncoding property set to null (default).

Any ideas how to make it happen?

Thanks in advance.

Maxim Avezbakiev.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Maxim,

you have to do this on a servlet by servlet or JSP by JSP basis.

For example in a servlet you would set prior to the beginning of the body the statement request.setCharacterEncofing("...utf8").

If it is a JSP you set the charset in the page directive. For more information on this topic please refere to http://java.sun.com/products/jsp/tags/11/syntaxref118.html

Former Member
0 Kudos

Hello.

Thank you for your reply.

I already found a more general solution -- and it is use of the Filters that were introduce in Servlet 2.3.

In a few words -- the custom filter will be invoked before the request will parse any parameters and there you can call for a request.setCharacterEncoding() method.

Thanks.

Maxim.