欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

基于jsp:included的使用與jsp:param亂碼的解決方法

 更新時間:2013年05月26日 14:45:02   作者:  
本篇文章是對jsp:included的使用與jsp:param亂碼的解決方法進行了詳細的分析介紹,需要的朋友參考下
如果jsp:include 中的page頁面存在亂碼,則需要在使用<jsp:include page=""> 的頁面中的<body>后加上
<%
    request.setCharacterEncoding('UTF-8") ;//或者指定的編碼(GBK或其他)
%>
如下面所示:
復制代碼 代碼如下:

jsp-include.jsp
<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<html>
 <head><title>jsp include測試頁</title></head>
 <body>
 <%
  request.setCharacterEncoding("UTF-8") ;
 %>
 <h3>jsp include 指令測試</h3>

 <jsp:include page="forward-result.jsp">
  <jsp:param name="age" value="32" />
  <jsp:param name="username" value="張三" />
 </jsp:include>

 </body>
</html>
forward-result.jsp
<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<html>
 <head><title>forward的結果頁</title></head>
 <body>
  年齡:<%=request.getParameter("age")%><br />
  姓名:<%=request.getParameter("username") +"--11"%>

 </body>
</html>

相關文章

最新評論