JAVA寒假13

 

 add1.jsp

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'reg.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 rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<center>
<font color=red size=72>用户添加页面</font>
<hr>
<form action="userlogin" method="post"">
<table border="1">

<tr>
<td>用户:</td>
<td><input name="UserName" value="" ></td>
</tr>

<tr>
<td>密码:</td>
<td><input type="password" name="UserPass" value="" ></td>
</tr>

<tr>
<td>邮件:</td>
<td><input type="text" name ="email" value=""></td>
</tr>

<tr>
<td>性别:</td>
<td><input type="text" name ="sex" value=""></td>
</tr>

<tr>
<td>年龄:</td>
<td><input type="text" name="age" value="" ></td>
</tr>

<tr>
<td colspan="2">
<center>
<input type="submit" value="提交">
<input type="reset" value="重置">
</center>
</td>
</tr>
</table>

</form>

</center>
</body>
</html>

index.jsp

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.cc.dao.*" %>
<%@ page import="com.cc.dao.impl.*" %>
<%@ page import="com.cc.entity.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'index.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 rel="stylesheet" type="text/css" href="styles.css">
-->
</head>



<body>
<h3>全部学生信息如下</h3>

<table width="800" border="100" cellSpacing=1 style="border: 1pt dashed ; font-size: 15pt;" height="31">
<tr>
<td>学号</td>
<td>姓名</td>
<td>密码</td>
<td>邮箱</td>
<td>年龄</td>
<td>性别</td>
<td>注册时间</td>
<td>上一次操作时间</td>
<td>操作</td>
</tr>
<%
IUserDao dao = new UserDaoImpl();
List<User> users = dao.findAllUser();
for (User u1 : users) {
%>

<tr>
<td><%=u1.getUserId()%></td>
<td><%=u1.getUserName()%></td>
<td><%=u1.getUserPass()%></td>
<td><%=u1.getEmail()%></td>
<td><%=u1.getAge()%></td>
<td><%=u1.getSex()%></td>
<td><%=u1.getRegisterDate()%></td>
<td><%=u1.getRecordDate()%></td>
<td>
<a href="SearchById?userId=<%=u1.getUserId()%>">修改</a>
</td>
<td>
<a href="delUser?Id=<%=u1.getUserId()%>">删除</a>
</td>
<%
}
%>

</table>
<p>
<p>
<h1><a href="add1.jsp">增加</a></h1>
</body>
</html>

login.jsp

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=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 rel="stylesheet" type="text/css" href="styles.css">
-->

</head>

<body>
This is my JSP page. <br>
</body>
</html>

modify.jsp

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ page import="com.cc.entity.*"%>

 


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>更新</title>
</head>
<body>
<center>
<font color=red size=72>用户修改页面</font>
<hr>
<form action="upUserServlet" method="post"">
<table border="1">
<tr>
<td>ID:</td>
<td><input name="userId" value="<%=request.getAttribute("userId") %>" ></td>
</tr>

<tr>
<td>姓名:</td>
<td><input name="userName" value="<%=request.getAttribute("userName") %>" ></td>
</tr>

<tr>
<td>密码:</td>
<td><input type="text" name ="userPass" value="<%=request.getAttribute("userPass") %>" ></td>
</tr>

<tr>
<td>邮箱:</td>
<td><input type="text" name ="email" value="<%=request.getAttribute("email") %>" ></td>
</tr>


<tr>
<td>性别:</td>
<td><input type="text" name ="sex" value="<%=request.getAttribute("sex") %>"></td>
</tr>

<tr>
<td>年龄:</td>
<td><input type="text" name="age" value="<%=request.getAttribute("age") %>" ></td>
</tr>

<tr>
<td colspan="2">
<center>
<input type="submit" value="提交">
<input type="reset" value="重置">
</center>
</td>
</tr>
</table>

</form>

</center>
</body>
</html>

sucess.jsp

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'success.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 rel="stylesheet" type="text/css" href="styles.css">
-->

</head>

<body>
<h1>操作成功</h1>
<table width="300" border="100" cellSpacing=1 style="border: 1pt dashed ; font-size: 15pt;" height="31">

<td>
<a href="index.jsp"">返回首页</a>

</td>


</table>
</body>
</html>

posted @ 2022-02-17 09:59  清谦  阅读(14)  评论(0)    收藏  举报