Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

retrieve domain name  RSS feed

 
John Eric Hamacher
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need a servlet filter to extract the domain name of a HTTP request's requestor. I have seen various opinions on this. Many of them say its not possible.

How about some thoughts here?

thanks

eric
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "referer" header is the one which contains the URL of the resource that submitted the request. At least it's supposed to be. It's possible for a requester to put anything it likes in there, but typically browsers won't lie about it. Perhaps that's what those other resources meant when they said "not possible". Although you didn't say anything about them except that they existed, so who knows? Looking for 100% certainty in the world of the Internet isn't very practical.
 
Niklas Rosencrantz
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is request.getServerName() what you're looking for? I hope so. It works for me.
yours truly
Niklas R
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!