如果jsp:include 中的page页面存在乱码,则需要在使用
的页面中的后加上
<%
request.setCharacterEncoding(\'UTF-8\") ;//或者指定的编码(GBK或其他)
%>
如下面所示:
jsp-include.jsp
<%@ page language=\"java\" contentType=\"text/html;charset=UTF-8\" %>
jsp include测试页
<%
request.setCharacterEncoding(\"UTF-8\") ;
%>
jsp include 指令测试
forward-result.jsp
<%@ page language=\"java\" contentType=\"text/html;charset=UTF-8\" %>
forward的结果页
年龄:<%=request.getParameter(\"age\")%>
姓名:<%=request.getParameter(\"username\") +\"--11\"%>
本文地址:https://www.stayed.cn/item/25496
转载请注明出处。
本站部分内容来源于网络,如侵犯到您的权益,请 联系我