[OmniFaces utilities] The
getRemoteAddr()
method returns the Internet Protocol (IP) address of the client that sent the request. This will first check the X-Forwarded-For
request header and if it's present, then return its first IP address, else just return HttpServletRequest#getRemoteAddr()
unmodified.
Starting with OmniFaces 2.3 this method is available in Servlets utility class also as, Servlets#getRemoteAddr().
Method:
OmniFaces 2.3 | OmniFaces 2.0 |
import org.omnifaces.util.Faces;
...
// 'remoteAddr' may be '0:0:0:0:0:0:0:1'
String
remoteAddr = Faces.getRemoteAddr();
Niciun comentariu :
Trimiteți un comentariu