入门客AI创业平台(我带你入门,你带我飞行)
博文笔记

<jsp:param>标签的使用

创建时间:2017-09-25 投稿人: 浏览次数:491

1:main.jsp

  

  <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<% request.setCharacterEncoding("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>主页面</title>
</head>
<body>
<div align="center">
<table>
<tr>
<th>主页面</th>
</tr>
</table>
</div>
<jsp:include page="subPage.jsp">
<jsp:param value="John" name="userName"/>
<jsp:param value="10086" name="passwd"/>
<jsp:param value="陕西西安" name="address"/>
</jsp:include>
</body>
</html>


   2:subPage

   

  <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<% request.setCharacterEncoding("UTF-8"); //设置页面传递参数的编码格式 %>
<%
String userName=request.getParameter("userName");
String passwd=request.getParameter("passwd");
String address=request.getParameter("address");
%>
<!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>子页面</title>
</head>
<body>
<div align="center">
<table>
<tr>
<th>子页面:人员信息</th>
</tr>
</table>
</div>
<div align="center">
<table>
<tr>
<td>用户名:<%=userName%></td>
</tr>
<tr>
<td>密&nbsp;&nbsp;&nbsp;&nbsp;码:<%=passwd%></td>
</tr>
<tr>
<td>用户地址:<%=address%></td>
</tr>
</table>
</div>
</body>
</html>

声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。