注册 登录
编程论坛 J2EE论坛

[求助]include 命令传参中文问题

rockbuffett 发布于 2007-10-05 15:45, 795 次点击

[求助]include 命令传参中文问题
我用include 命令传参,出现乱码问题。请各位兄弟帮忙解决。如何才能支持中文传参啊!


<%@page contentType="text/html;charset=gb2312"%>
<html>
<body>
<% String ok="你好";%>
<h1>
<jsp:include page="2.jsp">
<jsp:param name="b" value="<%=ok%>"/>
</jsp:include>
</h1>
</body>
</html>

2.jsp在这里

<%@ page contentType="text/html;charset=gb2312"%>
<%=request.getParameter("b")%>

2 回复
#2
netstriker2007-10-05 17:35
  试过了,都不行,可能不支持或者还有我们想不到的吧~~
#3
atsjun2007-10-06 00:35

得到的时候把String转一下
String s=(String)request.getParameter("b");
s=new String(s.getBytes("iso-8859-1"),"gb2312");
out.println(s);

1