jQuery in Action, 2nd edition*
The moose likes Servlets and the fly likes Getting server's address Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Getting server Watch "Getting server New topic

Getting server's address

Kenny Chen

Joined: Feb 02, 2006
Posts: 4
I'm having two Servlets/JSPs reside in two different servers.
Servlet1 resides in & Servlet2 resides in

After Servlet1 is being redirected to Servlet2, is there a way in Servlet2 to get Servlet1's server address?

Thanks a million!
Purushoth Thambu
Ranch Hand

Joined: May 24, 2003
Posts: 425
Did you check the output of Request.getRemoteHost() & getRemoteAddr() methods?
If these methods doesn't return the server1 IP address then you can query for HTTP header fields "Referer" & "Via". Even if these fields doesn't work then you have to add a field to the request from server1 before forwarding to the server2.
Don't get me started about those stupid light bulbs.
subject: Getting server's address
Similar Threads
Servlet calling a another servlet on different context.
Forward between Web Apps - How To?
HFSJ Chapter 6 - Mock exam Question 7
passing methods from one servlet to another servlet
Servlet - doGet - doPost - parameter