• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How find location that invoked the servlet?

 
Udara Amarasinghe
Ranch Hand
Posts: 109
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Is there any resource with servlet to find the URL of the location that invoked that servlet?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, the servlet offers no such information. Sometimes, you can check the "Referer" header, but it is not reliable.
 
Ninad Kulkarni
Ranch Hand
Posts: 802
Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Go through this, it may help you
 
Jeff Ishar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletRequest has a method to find the URL of request. please check the API documentation.



hope it helps
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeff Ishar wrote:ServletRequest has a method to find the URL of request. please check the API documentation.

That is not the same as the resource from which the servlet was invoked.
 
Udara Amarasinghe
Ranch Hand
Posts: 109
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for all comments.

Seems like there is only one solution. That is client of the servlet have send his URL with the request.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Udara Amarasinghe wrote:Thanks for all comments.

Seems like there is only one solution. That is client of the servlet have send his URL with the request.


Send the identity you mean ? Your question does not have an answer since the location that identifies a calling entity would be a IP and not a URL. A thick client can for example not be reached from a URL.

If identity is the problem, you can assign a pricinpal and role to the calling entity. That would help you authenticate and authorize the subject
 
Udara Amarasinghe
Ranch Hand
Posts: 109
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepak Bala wrote:Send the identity you mean ? Your question does not have an answer since the location that identifies a calling entity would be a IP and not a URL. A thick client can for example not be reached from a URL.

If identity is the problem, you can assign a pricinpal and role to the calling entity. That would help you authenticate and authorize the subject

No Deepak, I mean URL for the web page that included a link for the servlet and initiated the request for the servlet or something like that.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In that case you should take note of Bear's comment about the Referer header. There is no standard that allows anyone to track from where a URL click originated.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic