Posted By:
Rabih_Yazbeck
Posted On:
Thursday, February 27, 2003 06:23 AM
Hello, I have problem in trying to redirect my incoming requests to an absolute URL from a Servlet Filter. I have this filer: secureconnectionfilter cart.security.filter.SecureConnectionFilter secureconnectionfilter securitytest I cannot use the request dispatcher because it forwards to a relative address in the same servlet context only: RequestDispatcher rd = context.getRequestDispatcher("/index.jsp"); rd.forward(request, response); so I want to use sendRedirect, like: HttpServletResponse httpResponse = (HttpServletResponse) response; httpResponse.sendRedirec
More>>
Hello,
I have problem in trying to redirect my incoming requests to an absolute URL from a Servlet Filter.
I have this filer:
secureconnectionfilter
cart.security.filter.SecureConnectionFilter
secureconnectionfilter
securitytest
I cannot use the request dispatcher because it forwards to a relative address in the same servlet context only:
RequestDispatcher rd = context.getRequestDispatcher("/index.jsp");
rd.forward(request, response);
so I want to use sendRedirect, like:
HttpServletResponse httpResponse = (HttpServletResponse) response;
httpResponse.sendRedirect(httpResponse.encodeRedirectURL("http://localhost:8080/cart/index.jsp"));
But it is not working, it ignores the sendRedirect without throwing any exception! so how can I redirect to a new page from Filter outside the servlet context?
Any idea? Thank you in advance..
- Rabih
<<Less