-1

I need a structure which check if a request is sent by a local network computer or is sent by a remote client via internet.

Is it possible to get this using httprequest object or ip address?

IF client is a local network computer
  DO 1
IF Client is a remote computer from internet
  DO 2
Babak Behzadi
  • 1,236
  • 2
  • 16
  • 33

1 Answers1

0

If you have the HttpServletRequest you can look at the

request.getRemoteAddr() 
request.getLocalAddr()

These can be used to determine where the client request came from.

@See http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html

Mike Murphy
  • 1,006
  • 8
  • 16