Servlets response.sendRedirect(String url) doesn't seems to send the encoding, why?

Posted by Daziplqa on Stack Overflow See other posts from Stack Overflow or by Daziplqa
Published on 2010-05-21T01:52:40Z Indexed on 2010/05/21 2:00 UTC
Read the original article Hit count: 217

Filed under:
|
|
|

Hi folks,

I have some Servlet that explicity sets the character encoding and redirect to some servlet

class Servlet1 extends HttpServle{
   void doGet(..... ){
        // ...
        request.setCharacterEncoding("UTF-8");
        response.setCharacterEncoding("UTF-8"):
        //......
        response.redirect(servlet2);
    }
}

class Servlet2 extends HttpServle{
   void doGet(..... ){
        // ...
        request.getCharacterEncoding();  // prints null ?? why???
        //......

    }
}

So, why the character encoding not being send with the request?

© Stack Overflow or respective owner

Related posts about encoding

Related posts about servlets