java - Tomcat 500 error with JSP page - the only JSP contents is if/else -
i hope well.
i come php background , have had work on project based on java - found out jsp pages quite similar php. have tried make page has "string" variable declared, called account. check if account administrator, if can see admin menus. however, works fine me in firefox , chrome, customers using same browser seeing 500 error. please see details below logs, have no idea means know simple if statement shouldn't cause (stupid language).
mar 06, 2014 8:51:59 org.apache.catalina.core.standardwrappervalve invoke severe: servlet.service() servlet [jsp] in context path [/test] threw exception [an exception occurred processing jsp page /test.jsp @ line 126 123: </ul> 124: </li> 125: <% 126: if (account.equals("sysadmin")) { %> 127: <li> 128: <a href="#" target="_gts">assettrack</a> 129: <ul> stacktrace:] root cause java.lang.nullpointerexception @ org.apache.jsp.test_jsp._jspservice(test_jsp.java:203) @ org.apache.jasper.runtime.httpjspbase.service(httpjspbase.java:70) @ javax.servlet.http.httpservlet.service(httpservlet.java:728) @ 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:728) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:305) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210) @ org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:52) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:243) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210) @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:222) @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:123) @ org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:502) @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:171) @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:100) @ org.apache.catalina.valves.accesslogvalve.invoke(accesslogvalve.java:953) @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:118) @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:409) @ org.apache.coyote.http11.abstracthttp11processor.process(abstracthttp11processor.java:1044) @ org.apache.coyote.abstractprotocol$abstractconnectionhandler.process(abstractprotocol.java:607) @ org.apache.tomcat.util.net.jioendpoint$socketprocessor.run(jioendpoint.java:315) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) @ java.lang.thread.run(thread.java:744)
any ideas let me know, before go insane! thanks,
paul
try ,
if ((null!=account) && (account.equals("sysadmin")))
because says , have null pointer exception
. should check whether account
not null
hope helps !
Comments
Post a Comment