This week's book giveaway is in the iOS forum.
We're giving away four copies of Classic Computer Science Problems in Swift and have David Kopec on-line!
See this thread for details.
Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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: 8933
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: 8933
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!