<jsp:param>标签的使用
2017-09-25 21:14
429 查看
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>密 码:<%=passwd%></td>
</tr>
<tr>
<td>用户地址:<%=address%></td>
</tr>
</table>
</div>
</body>
</html>
<%@ 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>密 码:<%=passwd%></td>
</tr>
<tr>
<td>用户地址:<%=address%></td>
</tr>
</table>
</div>
</body>
</html>
相关文章推荐
- jsp:<c:redirect> 和<c:param> 标签
- HTML <object>与<param> 标签的使用
- jsp页面,使用Struts2标签,传递和获取Action类里的参数,注意事项。<s:a action><s:iterator><s:param>ognl表达式 在编写SSH2项目的时候,除
- jsp页面中使用JSTL标签库的<c:redirect>的一些疑问?
- jsp页面中使用JSTL标签库的<c:redirect>的一些看法和疑问?
- <c:param> 标签的使用
- <jsp:param>标签给属性赋值时的一个坑
- JSP中使用html中的<base>标签不起作用
- jsp的<c:if>标签test里面的多个空格导致判断错误
- <jsp:forward >标签
- JSP标签的<jsp:useBean>和<jsp:setProperty><jsp:getProperty>的使用
- <a>标签嵌套图片使用方法
- jsp使用<c:choose>标签
- <c:catch>标签的简单使用
- xmlspy只如何使用<xs:extend>标签
- <head> 标签使用
- struts2框架下-使用OGNL在jsp页面使用<s:set>标签时报错的解决方法
- Jsp:param标签的使用
- <welcome-file-list>标签作用,怎样使用
- 配置SpringMVC的<init-param>标签时的错误cvc-complex-type.2.4.a