<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ page isELIgnored="false" %><%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'main.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"> </head>
<body>
<center>
<form action="" method="post">
<table border="1" width="350">
<tr>
<td>
编号
</td>
<td>
姓名
</td>
<td>
修改
</td>
<td>
删除
</td>
</tr>
<c:forEach items="${list}" var="user">
<tr>
<td>
${user.userId}
</td>
<td>
${user.userName}
</td>
<td>
<a href="<%=path %>/student!findById.action?userid=${user.userId }">修改</a> </td>
<td>
<a href="<%=path %>/student!deleteStudent.action?userid=${user.userId }" onclick="return confirm('是否删除')">删除</a>
</td>
</tr>
</c:forEach> <tr>
<td colspan="5">
<input type="submit" value="添加">
</td>
</tr>
</table>
</form>
</center>
</body>
</html>
后台已经有暑假了 但是前台就是不显示???
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ page isELIgnored="false" %><%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'main.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"> </head>
<body>
<center>
<form action="" method="post">
<table border="1" width="350">
<tr>
<td>
编号
</td>
<td>
姓名
</td>
<td>
修改
</td>
<td>
删除
</td>
</tr>
<c:forEach items="${list}" var="user">
<tr>
<td>
${user.userId}
</td>
<td>
${user.userName}
</td>
<td>
<a href="<%=path %>/student!findById.action?userid=${user.userId }">修改</a> </td>
<td>
<a href="<%=path %>/student!deleteStudent.action?userid=${user.userId }" onclick="return confirm('是否删除')">删除</a>
</td>
</tr>
</c:forEach> <tr>
<td colspan="5">
<input type="submit" value="添加">
</td>
</tr>
</table>
</form>
</center>
</body>
</html>
后台已经有暑假了 但是前台就是不显示???
request.setAttribute("list", list);
User use=userDao.login(user);
if(use==null)
return ActionSupport.ERROR;
else
{
List<User> list=userDao.GetAllUser();
return ActionSupport.SUCCESS;
} }这是后台代码
User use=userDao.login(user);
if(use==null)
return ActionSupport.ERROR;
else
{
List<User> list=userDao.GetAllUser();
request.setAttribute("list", list);
return ActionSupport.SUCCESS;
}
}
不过你的request在这里好像取不到啊