JSP基于dom解析xml实例详解(3)

<%@ page language="java" import="java.util.*" pageEncoding="GBK"%> <% 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 'login.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>|<a href="https://www.jb51.net/insert.jsp">注册</a> <form action="login.action" method="post"> <table> <tr> <td> 用户名:</td><td><input type="text"></td> </tr> <tr> <td> 密码:</td><td><input type="password"></td> </tr> <tr> <td colspan="2"><input type="submit" value="登录"></td> </tr> </table> </form> </body> </html>

list.jsp

<%@ page language="java" import="java.util.*" pageEncoding="GBK"%> <%@ taglib uri="/struts-tags" prefix="s"%> <%@ 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 'list.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/insert.jsp">注册</a> <table> <tr> <td colspan="6"><font size="+3">用户列表</font></td> </tr> <tr> <td>序号</td><td>用户名</td><td>密码</td><td>邮箱</td><td>删除</td><td>编辑</td> </tr> <c:forEach items="${USER}" var="u" varStatus="temp"> <tr> <td>${temp.index+1}</td><td>${u.name }</td><td>${u.pwd }</td><td>${u.email}</td><td><a href="delete.action?uName=${u.name}">删除</a></td><td><a href="edit.action?uName=${u.name }">编辑</a></td> </tr> </c:forEach> </table> </body> </html>

insert.jsp

<%@ page language="java" import="java.util.*" pageEncoding="GBK"%> <% 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 'register.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> <form action="insert.action" method="post"> <table> <tr> <td> 用户名: </td> <td> <input type="text"> </td> </tr> <tr> <td> 密码: </td> <td> <input type="password"> </td> </tr> <tr> <td> 邮箱: </td> <td> <input type="text"> </td> </tr> <tr> <td colspan="2"> <input type="submit" value="提交"> </td> </tr> </table> </form> </body> </html>

update.jsp

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wzfygz.html