The full stack trace of the root cause is available in the Apache Tomcat/7.0.57 logs.
严重:Servlet.service()forservlet[RegisterServlet]incontextwithpath[/FoodServer]threwexc...
严重: Servlet.service() for servlet [RegisterServlet] in context with path [/FoodServer] threw exception
java.lang.NullPointerException
at java.net.URLDecoder.decode(Unknown Source)
at com.dy.servlet.RegisterServlet.doPost(RegisterServlet.java:45)
at com.dy.servlet.RegisterServlet.doGet(RegisterServlet.java:37)
第45行代码为
String userName = URLDecoder.decode(request.getParameter("userName"),"UTF-8"); 展开
java.lang.NullPointerException
at java.net.URLDecoder.decode(Unknown Source)
at com.dy.servlet.RegisterServlet.doPost(RegisterServlet.java:45)
at com.dy.servlet.RegisterServlet.doGet(RegisterServlet.java:37)
第45行代码为
String userName = URLDecoder.decode(request.getParameter("userName"),"UTF-8"); 展开
1个回答
2015-04-09
展开全部
你的request没有取首段御到值,你可者岩以输出request.getParameter("userName")的值燃并看一看。
更多追问追答
追问
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request没有取到值,要怎么解决哦
追答
没有取到值的可能性有很多,你可以检查一下你的参数名是否正确,是否与你传递参数一致等。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询