Error Cash:
Critical: Servlet.service () for Servlet Userservlet threw exception
Java.lang.NullPointerException
At Com.liuyang.servlet.UserServlet.doGet (userservlet.java:17)
At Javax.servlet.http.HttpServlet.service (httpservlet.java:617)
At Javax.servlet.http.HttpServlet.service (httpservlet.java:723)
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:103)
At Org.apache.catalina.valves.AccessLogValve.invoke (accesslogvalve.java:615)
At Org.apache.catalina.core.StandardEngineValve.invoke (standardenginevalve.java:109)
At Org.apache.catalina.connector.CoyoteAdapter.service (coyoteadapter.java:293)
At Org.apache.coyote.http11.Http11Processor.process (http11processor.java:861)
At Org.apache.coyote.http11.http11protocol$http11connectionhandler.process (http11protocol.java:612)
At Org.apache.tomcat.util.net.jioendpoint$worker.run (jioendpoint.java:503)
At Java.lang.Thread.run (thread.java:662)
The error is that my front-end interface input values cannot be passed to the background, so the background cannot be retrieved.
Code positioning
To this line, but there is no error in this line, then the code associated with it, the value passed is the value of username, so find the statement about username, the back-end code in the compiler did not give an error, indicating that the fault is not the backend
So go to the front to find the problem.
Finally found to be
There was an error here, not $ but the & symbol, which caused the value to fail to pass.
Servlet.service () for servlet Userservlet threw exception java.lang.NullPointerException null pointer exception