我做了一个基于Web的远程教学网站,框架使用的是Struts+hibernate想请教下如何在管理员模块实现用户删除这个功能。下面是页面,应该如何实现。实现的话需要在struts和hibernate下如何进行配置
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%
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 'studentlist.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">
-->
<style>
p{font-size:35px;
font-family:黑体;
color:red;
text-align:center;
}
span{
color:#ffba00;
font-size:17px;
font-weight:normal;
font-family:楷体_GB2312;
}
</style>
<base href="<%=basePath%>">
</head>
<body leftMargin=0 topMargin=0 marginwidth="500">
<p>
学生用户
<font color="#FF0000"></font> </p>
<hr align="center" color="blue" size="16">
<table class="datalist" summary="list of members in EE Studay"
align="center" width="800">
<tr>
<th align=center nowrap>
学号
</th>
<th align=center nowrap>
登陆名称
</th>
<th align=center nowrap>
真实姓名
</th>
<th align=center nowrap>
性别
</th> <th align=center nowrap>
申请日期
</th>
<th align=center>
操 作
</th>
</tr>
<c:forEach items="${stu.list}" var="appuser">
<tr id="tr"> <td>
${appuser.x_no}
</td>
<td>
${appuser.x_name}
</td>
<td>
${appuser.x_relname}
</td>
<td>
${appuser.x_xb}
</td>
<td>
${appuser.x_date}
</td>
<td align="center" nowrap>
<a href="sys.do?command=delspstu&x_no=${appuser.x_no}">删除</a>
</tr>
</c:forEach>
<tr bgcolor="red"> </tr>
</table>
<hr align="center" color="blue" size="1">
<h3 align="center">
当前第${stu.pageNo}页
<c:if test="${1 lt stu.pageNo }">
<a href="teacher.do?command=mystu_before&pageNo=${stu.pageNo}&pageSize=${stu.pageSize}&fac=1">上一页</a>
</c:if>
<c:if test="${stu.pageNo lt ((stu.totalRecords/stu.pageSize))}">
<a href="sec_card2.do?command=mystu_next&pageNo=${stu.pageNo}&pageSize=${stu.pageSize}&fac=1">下一页</a>
</c:if>
总共 ${stu.totalRecords}条记录 <span>输入查询条件 <input type="text" name="query"></span>
</h3><script language="javascript">
var rows = document.getElementsByTagName('tr');
for (var i=0;i<rows.length;i++){
rows[i].onmouseover = function(){ //鼠标在行上面的时候
this.className += 'altrow';
}
rows[i].onmouseout = function(){ //鼠标离开时
this.className = this.className.replace('altrow','');
}
}
</script>
</body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%
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 'studentlist.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">
-->
<style>
p{font-size:35px;
font-family:黑体;
color:red;
text-align:center;
}
span{
color:#ffba00;
font-size:17px;
font-weight:normal;
font-family:楷体_GB2312;
}
</style>
<base href="<%=basePath%>">
</head>
<body leftMargin=0 topMargin=0 marginwidth="500">
<p>
学生用户
<font color="#FF0000"></font> </p>
<hr align="center" color="blue" size="16">
<table class="datalist" summary="list of members in EE Studay"
align="center" width="800">
<tr>
<th align=center nowrap>
学号
</th>
<th align=center nowrap>
登陆名称
</th>
<th align=center nowrap>
真实姓名
</th>
<th align=center nowrap>
性别
</th> <th align=center nowrap>
申请日期
</th>
<th align=center>
操 作
</th>
</tr>
<c:forEach items="${stu.list}" var="appuser">
<tr id="tr"> <td>
${appuser.x_no}
</td>
<td>
${appuser.x_name}
</td>
<td>
${appuser.x_relname}
</td>
<td>
${appuser.x_xb}
</td>
<td>
${appuser.x_date}
</td>
<td align="center" nowrap>
<a href="sys.do?command=delspstu&x_no=${appuser.x_no}">删除</a>
</tr>
</c:forEach>
<tr bgcolor="red"> </tr>
</table>
<hr align="center" color="blue" size="1">
<h3 align="center">
当前第${stu.pageNo}页
<c:if test="${1 lt stu.pageNo }">
<a href="teacher.do?command=mystu_before&pageNo=${stu.pageNo}&pageSize=${stu.pageSize}&fac=1">上一页</a>
</c:if>
<c:if test="${stu.pageNo lt ((stu.totalRecords/stu.pageSize))}">
<a href="sec_card2.do?command=mystu_next&pageNo=${stu.pageNo}&pageSize=${stu.pageSize}&fac=1">下一页</a>
</c:if>
总共 ${stu.totalRecords}条记录 <span>输入查询条件 <input type="text" name="query"></span>
</h3><script language="javascript">
var rows = document.getElementsByTagName('tr');
for (var i=0;i<rows.length;i++){
rows[i].onmouseover = function(){ //鼠标在行上面的时候
this.className += 'altrow';
}
rows[i].onmouseout = function(){ //鼠标离开时
this.className = this.className.replace('altrow','');
}
}
</script>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货