I have a page: /myapp/test.jsp?queryString=Y . The filter should redirect to the current page. It should go to /myapp/test.jsp (without the query string). The following shows that this leads to the context root: / myapp . I am running in WAS6.1.
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException {
HttpServletRequest httpReq = (HttpServletRequest) req;
HttpServletResponse httpResp = (HttpServletResponse) resp;
{
boolean blnNeedToRedirect = true;
if (blnNeedToRedirect) {
httpResp.sendRedirect(".");
return;
}
chain.doFilter(req, resp);
}
source
share