views:

60

answers:

1

Hi Guys,

The server machine has a internal IP address of x.x.x.x and external IP address of y.y.y.y If the form action in JSP has the value x.x.x.x:9080 my code works properly But when it has the value y.y.y.y I am getting a bug. The code requires an internal IP address.

Is there a way that I can intercept all requests made using external IP address and change the request and make it as if its been called using internal IP address using only web.xml

Wat I want to do is that the subsequent pages that are displayed have y.y.y.y:9080/something in the URL I want it to be x.x.x.x:9080/something

This needs to be done only using web.xml Its a requirement. Help will be most appreciated Thanks in advance.

A: 

A simple solution is to set up a filter that intercepts all requests. In the filter, check if the request url is of the form "y.y.y.y:9080/something" and redirect to "x.x.x.x:9080/something" if it is.

Samit G.