- 

Available since OmniFaces 2.1

Collection of EL shortcut functions for obtaining information from the current HTTP request which isn't directly available via #{request} and thus otherwise requires some string concatenating and/or substringing.

The difference between #{of:getRemoteAddr()} and #{request.remoteAddr} is that the OmniFaces function recognizes and filters X-Forwarded-For header coming from proxies.

Demo
  • Request base URL: http://showcase.omnifaces.org/
  • Request domain URL: http://showcase.omnifaces.org
  • Request URL with query string: http://showcase.omnifaces.org/functions/Request
  • Remote addr: 54.81.196.35
Demo source code
<ul>
    <li>Request base URL: #{of:getRequestBaseURL()}</li>
    <li>Request domain URL: #{of:getRequestDomainURL()}</li>
    <li>Request URL with query string: #{of:getRequestURLWithQueryString()}</li>
    <li>Remote addr: #{of:getRemoteAddr()}</li>
</ul>