Sunday, January 1, 2017

How To Get Source IP Address from HttpServletRequest

The address of source of request is stored in the header of HttpServletRequest so it is simply to get it. If it is not available in header so we can get the RemoteAddress. Mark dependency to package javaee-web-api, current latest verion is 7.0 The util look like:

No comments :

Post a Comment