在每一个JSP页面头部加入<%@ taglib prefix="s" uri="/struts-tags" %>
1、用户列表页面(userlist.jsp)
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>增加用户</title>
</head>
<body>
<form action="#" method="post">
<table width="30%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CDCDCD">
<tr>
<td>ID号</td>
<td>用户名</td>
<td>密码:</td>
</tr>
<s:iterator id="user" value="#request.userlist">
<tr>
<td><s:property value="id"/></td>
<td><s:property value="name"/> </td>
<td><s:property value="password"/> </td>
<td><s:a href="delete.action?del=%{id}">删除</s:a></td>
<td><s:a href="edit.action?edit=%{id}">修改</s:a></td>
</tr>
</s:iterator>
<tr><td colspan="3" align="center"><s:a href="adduserlist.jsp">增加</s:a></td></tr>
</table>
</form>
</body>
</html>
2、用户添加页面(adduser.jsp)
<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>增加用户</title>
</head>
<body>
<form action="user.action" method="post">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CDCDCD">
<tr bgcolor="#FAFAFA">
<td>
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>用户名:<input type="text" name="user.name" class="text" value=""/></td>
</tr>
<tr>
<td>密码:<input type="password" name="user.password" class="text" value=""/></td>
</tr>
<tr>
<td align="center"><input type="submit" value="增加" style="border-style:none; background-color:#FAFAFA"/>
<input type="button" value="返回" οnclick="history.back();" style="border-style:none; background-color:#FAFAFA"/></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
3、用户编辑页面(edituser.jsp)
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>修改用户</title>
</head>
<body>
<form action="update.action" method="post">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CDCDCD">
<tr bgcolor="#FAFAFA">
<s:textfield name="user.id" label="ID号" value="${user.id}"></s:textfield>
<s:textfield name="user.name" label="用户名" value="${user.name}"></s:textfield>
<s:textfield name="user.password" label="密码" value="${user.password}"></s:textfield>
</tr>
<tr>
<s:submit name="submit" value="更新" align="left"></s:submit>
</tr>
</table>
</form>
</body>
</html>
4、用户登录页面(login.jsp)
<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>登录</title>
</head>
<body>
<form action="login.action" method="post">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CDCDCD">
<tr bgcolor="#FAFAFA">
<td>
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>用户名:<input type="text" name="user.name" class="text" value="shilei"/></td>
</tr>
<tr>
<td>密码:<input type="password" name="user.password" class="text" value="shilei"/></td>
</tr>
<tr>
<td align="right"><input type="submit" value="登陆" style="border-style:none; background-color:#FAFAFA"/></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
5、登录成功页面(success.jsp)
<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>登录</title>
</head>
<body>
登录成功
</body>
</html>