Java GetRequestDispatcher.forward再次通过doGet发送给我
我有一个覆盖了doGet的servlet。相关部分将是:Java GetRequestDispatcher.forward再次通过doGet发送给我,java,jsp,servlets,requestdispatcher,Java,Jsp,Servlets,Requestdispatcher,我有一个覆盖了doGet的servlet。相关部分将是: // called from doGet(req,res) private void serviceInternal(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log.info("servicing a request"); // magically compute j
// called from doGet(req,res)
private void serviceInternal(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
log.info("servicing a request");
// magically compute jsp path from request params (includes the
// logging of the app/mod/act as mentioned below
log.info(jspPath);
request.getRequestDispatcher(jspPath).forward(request, response);
}
现在,我正在记录进入服务方法的url,如果url是server:8080/context/app/mod/act?param=1,那么日志消息将显示app='app'mod='mod'act='act',我已经验证了这是否正常工作
当我尝试点击一些应该将我路由到jsp的东西时,出于某些愚蠢的原因,它会将我发送回我的doGet方法!我的日志如下所示:
INFO 2015-04-12 21:35:07,511 servicing a request
INFO 2015-04-12 21:35:07,519 app='' mod='' act='' uid='null'
INFO 2015-04-12 21:35:07,571 /WEB-INF/index.jsp
INFO 2015-04-12 21:35:07,571 servicing a request
INFO 2015-04-12 21:35:07,571 app='WEB-INF' mod='index.jsp' act='' uid='null'
但是我不想通过doGet发送我的jsp,我想将它发送到jsp!它为什么要这样做
我的servlet正在捕获/*,如果这有帮助的话。但我没想到它会抓住JSP
我做错了什么
我的servlet正在捕获/*,如果这有帮助的话。但我不会的
希望它能抓住JSP
你自己刚发现问题。这就是原因 所以。。。如何让它捕获非jsp?