乱码问题:
当 页面中有乱码问题时,servlet中解决方案:
- response.setContentType("text/html;charset=gbk");
- request.setCharacterEncoding("GBK");
在JSP中解决方案:
- <%@ page contentType="text/html;charset=gb2312"%>
解决post方式提交内容的乱码:
- request.setCharacterEncoding("GBK");
解决get方式提交内容的乱码:修改server.xml àURIEncoding="GBK"
解决<jsp:param name="user" value="<%=string%>"/>,url地址包含中文参数乱码问题:
- <%request.setCharacterEncoding("GBK");%>