过滤器使用forward重定向 报404错误,高手进来指点我一下吧

来源:互联网  时间:2016/6/29 12:51:53

关于网友提出的“ 过滤器使用forward重定向 报404错误,高手进来指点我一下吧”问题疑问,本网通过在网上对“ 过滤器使用forward重定向 报404错误,高手进来指点我一下吧”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:

问题: 过滤器使用forward重定向 报404错误,高手进来指点我一下吧
描述:

为什么在过滤器中使用forward重定向报404错误 public void doFilter(ServletRequest req, ServletResponse res, FilterChain filterChain) throws IOException, ServletException { ((HttpServletRequest)req).getRequestDispatcher("/newssi/error.jsp").forward(req, res);<> //filterChain.doFilter(req, res);
} 使用sendredirect,却能正常访问 public void doFilter(ServletRequest req, ServletResponse res,
FilterChain filterChain) throws IOException, ServletException { //((HttpServletRequest)req).getRequestDispatcher("/newssi/error.jsp").forward(req, res);
((HttpServletResponse)res).sendRedirect("/newssi/error.jsp");
//filterChain.doFilter(req, res);
}

上一篇这里面的错误怎么改
下一篇安装mysql第四步(apply security settings)错误1045,失败,急救!!防火墙已关闭,重装不管。
明星图片
相关文章
《 过滤器使用forward重定向 报404错误,高手进来指点我一下吧》由码蚁之家搜集整理于网络,
联系邮箱:mxgf168#qq.com(#改为@)