日期:2014-05-18  浏览次数:20619 次

iframe小问题
我在A.JSP上的代码如下:
<iframe src="message.jsp?value=点击标签选择所需浏览权限的系统!" name="bottomcontent" id="bottomcontent" width="100%" height="100%" frameborder="0"></iframe>
B.JSP上如下:
 String info = request.getParameter("value");
<td><%=info%></td>
现在访问A.JSP时候就出现乱码了.
请大家帮忙SEE一下,
TOMCAT5.5 myeclipse6.0 mysql 5.0

------解决方案--------------------
建议传值时不要传汉字
就现在的问题来说,你不用iframe乱不?
------解决方案--------------------
参数如果是中文 就会出现乱码

如果要传中文,就要进行编码,接收参数时再解码

------解决方案--------------------
new String(request.getParameter("value").getBytes('iso8859-1'))
------解决方案--------------------
正解
------解决方案--------------------
正解
------解决方案--------------------
String(request.getParameter("value").getBytes('iso8859-1'))
后面加上编码
------解决方案--------------------
直接写中文在url后面好象是有问题 还是用E文把
------解决方案--------------------
这种Get请求就是存在这种问题
参考
http://blog.csdn.net/hudon/archive/2008/01/18/2051332.aspx
------解决方案--------------------
new String(request.getParameter("value").getBytes('iso8859-1'),"gb2312")