这是我的遍历jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<table width="300" border="1" cellpadding="0">
<tr>
<th>姓名</th>
<th>密码</th>
<th>身份</th>
</tr>
<c:forEach var="u" items="${list}" >
<form action="CusSelectAllServlet" method="post">
<tr>
<td><input type="text" value="${u.name}" name="name" ></td>
<td><input type="text" value="${u.password}" name="password">
<td><input type="text" value="${u.identity }" name="identity">
</tr>
</form>
</c:forEach>
</table>
</body>
</html>
这是我的Servlet的代码
package Servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import dao.CusDao;
import dao.CusDaoImpl;
@WebServlet("/CusSelectAllServlet")
public class CusSelectAllServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public CusSelectAllServlet() {
super();
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");
CusDao cd=new CusDaoImpl();
cd.selectall();
request.setAttribute("list", cd.selectall());
//从Servlet跳转到showinfo.jsp页面,并且带上request和response对象中原有的参数
request.getRequestDispatcher("/ShowAll.jsp").forward(request, response);
}
}
这是我的impl的方法代码
public List<CusInformation> selectall() {
List<CusInformation> list = new ArrayList<CusInformation>();
try {
String sql = "select * from customer;";
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
while(rs.next()) {
CusInformation cusinfor = new CusInformation();
cusinfor.setName(rs.getString("cusname"));
cusinfor.setPassword(rs.getString("cuspassword"));
cusinfor.setIdentity(rs.getString("identity"));
list.add(cusinfor);
}
rs.close();
pstmt.close();
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
return list;
}
这是我的报错信息
HTTP Status 500 – Internal Server Error
Type Exception Report
Message java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/LoopTag
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/LoopTag
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:338)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Servlet.CusSelectAllServlet.doPost(CusSelectAllServlet.java:39)
javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause
java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/LoopTag
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:763)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2277)
org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:811)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1254)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1241)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1473)
org.apache.jasper.compiler.Parser.parse(Parser.java:145)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:244)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:105)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:201)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:372)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:349)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:333)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:600)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:368)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Servlet.CusSelectAllServlet.doPost(CusSelectAllServlet.java:39)
javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause
java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.LoopTag
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1285)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:763)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2277)
org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:811)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1254)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1241)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1473)
org.apache.jasper.compiler.Parser.parse(Parser.java:145)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:244)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:105)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:201)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:372)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:349)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:333)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:600)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:368)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Servlet.CusSelectAllServlet.doPost(CusSelectAllServlet.java:39)
javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Note The full stack trace of the root cause is available in the server logs.
拜托拜托,请指出一下我错误的地方(系统中有提示过我的jsp页面中的<form>语句中有警告)