Skip to Content
author's profile photo Former Member
Former Member

Request character encoding.


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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 15, 2003 at 05:11 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member


      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.



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.