jsp页面转发forward的使用
来源:互联网 发布:魔兽世界70数据库 编辑:程序博客网 时间:2024/05/17 17:17
1:页面
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<% request.setCharacterEncoding("utf-8");%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>主页面</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>
<body>
<div align="center">
<table>
<tr>
<th>主页面</th>
</tr>
</table>
</div>
<jsp:forward page="subPage.jsp">
<jsp:param value="John" name="userName"/>
<jsp:param value="10086" name="password"/>
<jsp:param value="北京海淀" name="address"/>
</jsp:forward>
</body>
</html>
2:跳转后的页面
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<% request.setCharacterEncoding("utf-8");%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>子页面</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>
<body>
<%
String userName=request.getParameter("userName");
String password=request.getParameter("password");
String address=request.getParameter("address");
%>
<div align="center">
<table>
<tr>
<th>子页面:人员信息</th>
</tr>
<tr>
<td>用户名:<%=userName%></td>
</tr>
<tr>
<td>密 码:<%=password%></td>
</tr>
<tr>
<td>地址:<%=address%></td>
</tr>
</table>
</div>
</body>
</html>
- jsp页面转发forward的使用
- useBean(通过jsp申明对象)、 包含(include )、 <jsp:forward page="转发的页面>
- jsp:forward的使用
- JSP的forward标签使用
- 请求转发 jsp:forward和sendRedirect的区别
- JSP 中 forward 转发 和 sendRedirect 重定向的区别
- 【JSP开发】JSP的forward标签使用
- 使用jsp的forward指令进行页面跳转时注意session对象的清除
- struts2 中使用jsp:forward 的方法
- servlet转发页面redirect和forward
- Servlet实现通过getRequestDispatcher().forward页面转发
- 页面重定向和forward转发
- JSP,SERVLET 页面转发
- JSP 页面转向 页面转发
- <jsp:forward>与response.sendRedirect()页面跳转的区别
- struts2中Action的各项默认值及使用Action直接转发jsp页面
- JSP 关于<jsp:forward>的使用以及传递参数
- jsp reuest转发,response重定向 以及pageContext对forward和include的简写
- 11.6模拟赛
- Win7下的OpenGL安装
- 【NOIP2016提高A组集训第12场11.10】灵知的太阳信仰
- div模拟的下拉框
- SRM 553 Div1
- jsp页面转发forward的使用
- 每日一练---计时器
- c++多线程单例模式实现
- React-Native 学习(一)
- hadoop平台下的数据导入导出工具Sqoop
- 【Oracle】函数
- 利用ugui做血条和漂浮文字
- Hive锁与并发模型
- 自己动手写一个Camera