I am unable to call a JSP using RequestDispatcher forward
I have this servlet calling this JSP
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%
%>
</body>
</html>
But dont know why this is giving me this error
Sep 10, 2011 4:15:23 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet Test threw exception java.lang.NullPointerException at org.apache.jsp.Mine_jsp._jspInit(Mine_jsp.java:22) at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52) at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:164) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:338) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646) at org.apache.catalina.core.ApplicationDispatcher.d oInclude(ApplicationDispatcher.java:551) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488) at Test.doGet(Test.java:31) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyot e.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619)
java.lang.NullPointerException at org.apache.jsp.Mine_jsp._jspInit(Mine_jsp.java:22)
A NPE on _jspInit()
is typical whenever the /WEB-INF/lib
folder of the webapp is littered with servletcontainer-specific libraries such as jsp-api.jar
, j2ee.jar
, etcetera. This is a major mistake, those libraries belong in the servletcontainer side. Cleanup your /WEB-INF/lib
folder to remove them all. If you put them there to overcome compilation errors, you should have solved it differently. See also How do I import the javax.servlet API in my Eclipse project?
上一篇: 在jsp中上传文件的问题