设置servlet请求和响应为utf-8,如下:
HttpServletRequest request = this.getRequest();
HttpServletResponse response = this.getResponse();
try {
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
} catch (UnsupportedEncodingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
网友评论