Reputation: 3449
I have a servlet and I use
String error = "error";
request.setAttribute("loginError", error);
request.setCharacterEncoding("UTF-8");
request.getRequestDispatcher("/index.jsp").forward(request, response);
and I use
<%@ page language="java" contentType="text/html; charset=ISO-8859-9"
pageEncoding="ISO-8859-9"%>
in my jsp page, also
request.setCharacterEncoding("UTF-8");
But if I forward a page, this pages' encoding does not work. How can I handle this encoding? Thanks.
Upvotes: 2
Views: 2128
Reputation: 55
I had the same problem and i found your unanswered question. I solved it with adding
response.setContentType("text/html;charset=UTF-8");
Upvotes: 2