示例:
T1.jsp
http://localhost:8080/test/Test.action?site=北京
T2.jsp
.....
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> .........以上省略........ <div>${site}</div>
.....
然后会出现乱码
解决办法 在目标jsp中插入一下代码
<% String ssss="默认"; if(request.getParameter("site")!=null){ ssss = request.getParameter("site"); ssss=new String(ssss.getBytes("ISO8859_1"),"UTF-8"); } request.setAttribute("site", ssss); %>