-
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 #{o: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: 216.73.216.101
Demo source code
<ul>
<li>Request base URL: #{o:getRequestBaseURL()}</li>
<li>Request domain URL: #{o:getRequestDomainURL()}</li>
<li>Request URL with query string: #{o:getRequestURLWithQueryString()}</li>
<li>Remote addr: #{o:getRemoteAddr()}</li>
</ul>Documentation & Sources