JSP页面跳转

zhengmj777 zhengmj777 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
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显示正常,各位大侠如何解决?
...全文

相关推荐

评论 9
收藏 已收藏
分享
返回顶部
zhengmj777
Web 开发 81,108 成员 341,721 内容