• cdi
  • components
  • contexts
  • converters
  • el
  • eventlisteners
  • exceptionhandlers
  • facesviews
  • filters
  • functions
  • managedbeans
  • push
  • resourcehandlers
  • scripts
  • servlets
  • taghandlers
  • utils
  • validators
  • viewhandlers
 - 
  • Arrays
  • Converters
  • Dates
  • Numbers
  • Objects
  • Request
  • Strings

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://snapshot.omnifaces.org/
  • Request domain URL: http://snapshot.omnifaces.org
  • Request URL with query string: http://snapshot.omnifaces.org/functions/Request
  • Remote addr: 174.129.163.89
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>