aspose file tools*
The moose likes Servlets and the fly likes Servlet Filter Redirection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet Filter Redirection" Watch "Servlet Filter Redirection" New topic
Author

Servlet Filter Redirection

PJ Crump
Ranch Hand

Joined: Feb 06, 2002
Posts: 51
I have a soap message (axis) coming into a server. Because I don't
want to handle certain types of requests, I have created a servlet
filter to do the checking for me and to route the request to a <different> physical server. When the servlet filter kicks off
all is good until I try to redirect the request to the third server.
The redirect does not work. Here is the code from my filter..

....
//I check the request for the condition that I'm looking for
// if the condition exists, then i want to redirect this request to
another server..

HttpServletResponse servResp = (HttpServletResponse)response;
servResp.sendRedirect("http://otherserver:8080");
return;
...

Any ideas??
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The redirect does not work.


Can you describe what does happen?
"does not work" can mean a lot of things.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
PJ Crump
Ranch Hand

Joined: Feb 06, 2002
Posts: 51
It never forwards the request to the 2nd server. The filter responds with the regular output. There is no exception that is thrown..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet Filter Redirection