File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Redirect Proxy Filter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Redirect Proxy Filter" Watch "Redirect Proxy Filter" New topic

Redirect Proxy Filter

Robert Garrido
Ranch Hand

Joined: Dec 11, 2008
Posts: 30
Hi all,

I have a big trouble, we wrote three different wap apps. for different purposes, these wap apps. make redirections between each other depending on the client status.

As an example, consider a client makes this request:

get /app_a
returns redirect /app_a/
get /app_a/
returns redirect /app_b/?from=app_a
get /app_b/?from=app_a
returns redirect /app_b/?from=app_a/
get /app_b/?from=app_a/
returns redirect /app_c/?from=app_b
returns get /app_c/?from=app_b/
returns final real page

The problem is that is it's not only very inefficient but we have problems with some handsets that don't like these redirections, they just blow up. Using forwards does not work since it does not work for servlets or jsps in different contexts.

The solution is to create a filter proxy that makes all the job, it would get the initial request from the client, then process all redirections and deliver the final page.

I would appreciate any guidance about how to do that, from how to intercept any request to any of the three wap apps, to how to handle the interim redirections and how to return the final result. If by coincidence you know any web page with code that works somehow similar to my needs please let me know.

Thanks indeed!

I agree. Here's the link:
subject: Redirect Proxy Filter
It's not a secret anymore!