jsp跳轉標簽


forward.jsp

<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
<jsp:forward page="target.jsp">
<jsp:param value="1234" name="userName"/>
<jsp:param value="123456" name="password"/>
</jsp:forward>
</body>
</html>

target.jsp

<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
服務器內部跳轉后的頁面<br/>
userName:<%=request.getParameter("userName") %><br/>
password:<%=request.getParameter("password") %><br/>
</body>
</html>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



猜您在找 標簽失效異常"> 標簽失效異常 、requestDispatcher和sendRedirect()的區別 jsp動作元素之forward指令 JSP動作元素include/forward 重定向redirect與跳轉forward區別 關於JSP不能通過瀏覽器直接訪問,要通過servlet跳轉,但一個jsp文件里面用