`
major1314
  • 浏览: 1297 次
  • 性别: Icon_minigender_1
  • 来自: 成都
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

一个要命的异常

阅读更多

最近在做一个小的实验室管理系统,内部使用的。
有这么一个链接
<html:link action="/getProject.do?pageMethod=first&projectname=${projectname}">首页</html:link>
后台通过request.getParameter("projectname")获取后,进行判定空值、null后组成相应的select语句
但在判定的时候,写成了if(!projectname.equals("")&& projectname != null)的形式了,结果就出现了下面的异常,汗颜呀,直接出了servlet异常,查找了半天,看来代码一定要小心,记下来做教训
严重: Servlet.service() for servlet action threw exception
javax.servlet.ServletException
at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at cuit.isi.labsys.servlet.EncodingFilter.doFilter(EncodingFilter.java:26)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at cuit.isi.labsys.filter.SetCharacterEncoding.doFilter(SetCharacterEncoding.java:21)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:866)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:716)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1498)
at java.lang.Thread.run(Thread.java:595)

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics