jsp 设置了request.setCharacterEncoding("gbk")还是出现了乱码
<%
request.setCharacterEncoding("gbk");
String tname = request.getParameter("tname");
System.out.println(tname);
TopicDAO add = new TopicDAOImpl();
boolean result = add.addTopic(tname);
if (result) {
out.print("成功");
} else {
out.print("失败");
}
%>
这里面输出tname的还是乱码.
------解决方案--------------------
在传tname页面也要设置编码