-
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: https://showcase.omnifaces.org/
- Request domain URL: https://showcase.omnifaces.org
- Request URL with query string: https://showcase.omnifaces.org/functions/Request
- Remote addr: 3.144.40.239
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>
Documentation & Sources