Wednesday, April 20, 2011

How to Get Application Server Name and Port in ADF

Quick post about how to get information for application server name and port in ADF. This particularly can be useful for instrumentation solutions. In order to get server name and port, you should acquire HttpServletRequest from ExternalContext, see example:


This example is accessing URL information from login method, but you can do it from any other place as well. Data is stored in session scope and later retrieved:


Server name and port are reported as expected:


Download sample application - SecurityFormLoginServerParams.zip

No comments: