初学servlet 新建servlet项目报nullpointerexception异常
web.xml配置文件
目录
HelloWorldServlet代码
应该是this.doPost(request, response);
你调用doPost方法,response传参是null,当然会空指针了
https://www.cnblogs.com/xdp-gacl/p/4005791.html
this.doPost(request, response); 为什么你的后面穿null?
this.doPost(request, null)
doPost(request,null)这里传入null,当然要报null 呀
https://blog.csdn.net/mht1829/article/details/52915498
doPost(request,null)这里传入null,当然要报空指针了
doPost(request,null)方法参数问题,后面不能为null
doPost(request,null)传递的response是null,而在doGet里面使用了response.getWriter(),所以就是null.getWriter(),就空指针异常了