日期:2014-05-17  浏览次数:20862 次

JSP页面跳转
本帖最后由 mingjian_zheng 于 2013-01-10 18:23:24 编辑
formTest.jsp代码(提交form):

<%@page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head><title>表单页面</title></head>
<body>
<form name="loginForm" action="secondDemo.jsp" method="post">
<input type="text" name="userName" />
<input type="submit" value="提交"/>
</form>
</body>
</html>


secondDemo.jsp(显示提交内容):

<%@page contentType="text/html charset=UTF-8"%>
<%@page import="java.util.Map"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>第二个Demo</title>
</head>
<body>
<%
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
%>
<%=request.getParameter("userName")%>
</body>
</html>



在IE浏览器提交后提示下载,但在firefox显示正常,各位大侠如何解决?

------解决方案--------------------
执行了叫 "secondDemo.jsp"  的 action??
------解决方案--------------------
IE里面提示下载?
------解决方案--------------------
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
为什么不设置UTF-8?
------解决方案--------------------
不知道这个情况,应该是和浏览器有关,个人觉得,这两个页面上的编码不统一,会造成乱码。
------解决方案--------------------
引用:
不知道这个情况,应该是和浏览器有关,个人觉得,这两个页面上的编码不统一,会造成乱码。


是和浏览器有关。怎么解决就不清楚了。
------解决方案--------------------
实在解决不了就算了,反正页面跳转基本上不会用这种方法。