<%@ 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>
<%--实例化一个javabean对象 --%>
<jsp:useBean id="myUsers" class="com.po.Users" scope="page"/>
<h1>setProperty动作元素</h1>
<hr>
<%
request.setCharacterEncoding("utf-8");
%>
<!-- 根据表单自动匹配所有的属性 -->
<%--<jsp:setProperty property="*" name="myUsers"/>--%>
<!-- 根据表单匹配所有部分的属性 -->
<jsp:setProperty property="myUsers" name="password"/>
用户名:<%=myUsers.getUsername() %><br>
密码:<%=myUsers.getPassword() %><br>
</body>
</html>
晕~name写错了