<%@ page language="java" import="java.util.*" pageEncoding="GBK"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"https://www.jb51.net/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="https://www.jb51.net/<%=basePath%>"> <title>My JSP 'update.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link type="text/css" href="https://www.jb51.net/styles.css"> --> </head> <body> <a href="https://www.jb51.net/list.action">首页</a> <h2>更新操作</h2> <form action="update.action" method="post"> <table> <c:set value="${USER}" var="user"></c:set> <tr> <td> 用户名:</td><td><input readonly="readonly" value="${user.name}" type="text"></td> </tr> <tr> <td> 密码:</td><td><input type="password" value="${user.pwd }"></td> </tr> <tr> <td> 邮箱:</td><td><input type="text" value="${user.email }"></td> </tr> <tr> <td colspan="2"><input type="submit" value="保存"></td> </tr> </table> </form> </body> </html>
本人学习所用的user.xml文件
<?xml version="1.0" encoding="UTF-8"?> <users> <user email=aaa@sina.com pwd="aaaaaa"/> <user email=bbb@sina.com pwd="aaaaaa"/> </users>