code: static public boolean isFromLocalhost(HttpServletRequest request){
  		String addr = request.getRemoteAddr();
  		return "0:0:0:0:0:0:0:1".equals(addr) || "::1".equals(addr)
  				|| (addr != null && addr.startsWith("127."));
  	}
docs: Check to see if the request is from localhost
  @param request	the http request
  @return	true if it is from localhost, false if not.