aspose file tools*
The moose likes Servlets and the fly likes internal  or external request. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "internal  or external request." Watch "internal  or external request." New topic
Author

internal or external request.

hasan khan
Ranch Hand

Joined: Aug 04, 2003
Posts: 222

my website can be access at http://www.mydomain.com/mycontext/ by external users and
we the internal user can also access the web site by using some internal ip : http://10.20.30.40/mycontext/

how do i distinguish wheater the request has come from internal or external.
[ June 14, 2006: Message edited by: hasaN khaN ]

SCJP, SCWCD
Darren Edwards
Ranch Hand

Joined: Aug 17, 2005
Posts: 69
Use the Host header from HTTP (assuming you are using HTTP1.1, but most people are!)

hasan khan
Ranch Hand

Joined: Aug 04, 2003
Posts: 222

i know about host header, but i want to distinguish between domain name or IP is coming in the host header.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Read the header.
If it contains your domain name, you know the requests was from your domain name.
If it contains the IP number, then you know it came from the IP number.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: internal or external request.