Request Encoding The request encoding is the character encoding in which parameters in an incoming request are interpreted. Currently, many browsers do not send a request encoding qualifier with the Content-Type header. In such cases, a Web container will use the default encoding�ISO-8859-1�to parse request data. If the client hasn�t set character encoding and the request data is encoded with a different encoding from the default, the data won�t be interpreted correctly. To remedy this situation, you can use the ServletRequest.setCharacterEncoding(
String enc) method to override the character encoding supplied by the container.
You must call the method or tag before parsing any request parameters or reading any input from the request. Calling the method or tag once data has been read will not affect the encoding. Response Encoding This is required to get multilingual data on UI side of our application.
The setCharacterEncoding, setContentType, and setLocale methods can be called repeatedly to change the character encoding. Calls made after the servlet response�s getWriter method has been called or after the response is committed have no effect on the character encoding. Data is sent to the response stream on buffer flushes (for buffered pages) or on encountering the first content on unbuffered pages. Calls to setContentType set the character encoding only if the given content type string provides a value for the charset attribute. Calls to setLocale set the character encoding only if neither setCharacterEncoding nor setContentType has set the character encoding before. For
Java Servlets, you can specify a page encoding in the HTTP header by calling the setContentType() method of the Servlet API. The following doGet() function shows how this method should be called.
Hope this helps. Just check where u made mistake. and Let us know
