私は私のdoGetを次のように持っています:
protected void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException{
String resourceIDstr = request.getParameter("ResourceID");
int resourceID = Integer.valueOf(resourceIDstr);
Resource resourceToLend = ResourceModule.getInstance()
.getResourceByID(Integer.valueOf(resourceID));
request.setAttribute("resourceToLent", resourceToLend);
request.setAttribute("innerTab", "LendResource.jsp");
getServletConfig().getServletContext()
.getRequestDispatcher("/WEB-INF/jsp/admin/resourcelend.jsp")
.forward(request, response);
}
GETリクエストをこのサーブレットに転送するときはいつでも、リクエストをJSPに転送せず、代わりに次のように例外をスローします。
HTTP Status 500 - org.apache.jasper.JasperException:
java.lang.NullPointerException
奇妙なことに、この特定のJSPは他のサーブレットによって問題なく使用されており、この特定のサーブレットは例外をスローします。例外の考えられる原因を見つけようとしています。
前もって感謝します。
アップデート:
org.apache.jasper.JasperException: org.apache.jasper.JasperException: java.lang.NullPointerException
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:549)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
servlet.TempResourceLendServlet.doGet(TempResourceLendServlet.java:37)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause
org.apache.jasper.JasperException: java.lang.NullPointerException
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:549)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:954)
org.apache.jsp.WEB_002dINF.jsp.admin.resourcelend_jsp._jspService(resourcelend_jsp.java:114)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
servlet.TempResourceLendServlet.doGet(TempResourceLendServlet.java:37)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause
java.lang.NullPointerException
org.apache.jsp.WEB_002dINF.jsp.admin.LendResource_jsp._jspService(LendResource_jsp.java:84)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:954)
org.apache.jsp.WEB_002dINF.jsp.admin.resourcelend_jsp._jspService(resourcelend_jsp.java:114)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
servlet.TempResourceLendServlet.doGet(TempResourceLendServlet.java:37)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)