• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Server Name and URL  RSS feed

 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Small question I have.
If the link to my application is on four different portals, Then how can i
know in my application where the request has come from?I need to get the
server name and URL of the application from which my application was
requested.

Thanx
 
Ranch Hand
Posts: 8934
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is the server implemented ? Is it a servlet?
 
Sahil Sharma
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thats correct.
 
Pradeep bhatt
Ranch Hand
Posts: 8934
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the getRemoteAddr() of the HttpServletRequest interface.
http://java.sun.com/webservices/docs/1.4/api/javax/servlet/http/HttpServletRequest.html
 
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Servlet forum...
 
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Sahil Sharma:
Hi all,

Small question I have.
If the link to my application is on four different portals, Then how can i
know in my application where the request has come from?I need to get the
server name and URL of the application from which my application was
requested.

Thanx



Are you looking for something like a "referrer"?
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..

use getHostName() or getRequestURL() in http.servlet.http.HttpServletRequest object

cheers
vasu
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!