<%@ page language="java" import="java.util.*" contentType="text/html;charset=gb2312" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<jsp:useBean id="user" scope="session" class="com.javaweb.test.UserBean" />
<!-- *表示通配符,也就是设置所有属性 param指定的是参数的名称 -->
<!-- property表示为java类中的属性,param指定的是input当中的输入框的名字 -->
<jsp:setProperty name="user" property="username" value="session_username"/>
<jsp:setProperty name="user" property="password" value="session_password"/>
<a href="test.jsp">test.jsp</a>
</body>
</html>
<%@ page language="java" import="java.util.*" contentType="text/html;charset=gb2312" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<jsp:useBean id="user" scope="session" class="com.javaweb.test.UserBean" />
用户名:<jsp:getProperty name="user" property="username"/><br>
密 码:<jsp:getProperty name="user" property="password"/><br>
</body>
</html>