• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting server's address

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm having two Servlets/JSPs reside in two different servers.
e.g.
Servlet1 resides in 100.0.0.001 & Servlet2 resides in 100.0.0.002

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


Thanks a million!
 
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic