首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

为甚麽小弟我用request.getRequestDispatcher获得Nullpointer

2011-11-21 
为甚麽我用request.getRequestDispatcher获得Nullpointerrequest.getRequestDispatcher(index+.jsp).f

为甚麽我用request.getRequestDispatcher获得Nullpointer
request.getRequestDispatcher("index"+".jsp").forward(request,response);

严重: Servlet.service() for servlet [jsp] in context with path [/twitter3] threw exception [java.lang.NullPointerException] with root cause
java.lang.NullPointerException
at org.apache.jsp.test_jsp._jspService(test_jsp.java:94)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

改成

<jsp:forward page="index.jsp"/>就好啦

[解决办法]
楼主什么意思
是问问题吗
[解决办法]
LZ看下response.sendRedirect()和request.getRequestDispatcher().forwar(request,response)的区别

热点排行