2013-12-5 11:15:46 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [jsp] in context with path [/module-linkman] threw exception [javax.servlet.ServletException: java.lang.NullPointerException] with root cause
java.lang.NullPointerException
at org.apache.tomcat.util.http.parser.HttpParser.parseMediaType(HttpParser.java:217)
at org.apache.tomcat.util.http.parser.MediaTypeCache.parse(MediaTypeCache.java:54)
at org.apache.catalina.connector.Response.setContentType(Response.java:805)
at org.apache.catalina.connector.ResponseFacade.setContentType(ResponseFacade.java:245)
at org.apache.jsp.pages.sgllinkman.addSglGroup_jsp._jspService(addSglGroup_jsp.java:61)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:88)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.chinaboxun.module.linkman.filter.SessionFilter.doFilter(SessionFilter.java:101)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:314)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
情况是这样的,一个父页面index.jsp其中的page指令为:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
子页面addSglGroup.jsp的page指令:
<%@ page language="java" contentType="text/html;" pageEncoding="UTF-8"%>
当点击打开这个子页面addSglGroup.jsp的时候提示上面贴出的错误。可把我找死了,利用删除代码各个排除的方法,发现了这个page指令有问题,果然去掉子页面的contentType="text/html;"过后页面正常打开了。很费解这是为什么,求解惑!!!
------解决方案--------------------
contentType="text/html;"是不是你这多写了个分号