0

I have two apps deployed in my app server. Let's say they have the following urls

  1. localhost:9080/App1
  2. localhost:9080/App2

I have a filter in App2 which catches a certain request. When I catch this request I would want to forward it to a url in App2.

I know this can be done by

response.sendRedirect("http://somewhere");

but what if I do not want to hardcode "localhost:9080" in my codes since this would be dynamic and would change later on.

how can i do this?

1 Answers1

1

Have you tried

response.sendRedirect("/relativePathToRedirect");

Relative redirects are allowed AFAIK

Please refer

http://en.wikipedia.org/wiki/HTTP_location

Is a 302 Redirect to relative URL valid, or invalid?

Community
  • 1
  • 1
ramp
  • 1,256
  • 8
  • 14