I’m currently working on a WebSphere 6.1 Web Project.
In my java code, how can i get the current running application port?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The servlet API gives you the local port in HttpServletRequest.
The ports are defined in the node’s serverindex.xml (e.g. [WAS]/profiles/AppSrv01/config/cells/localhostNode01Cell/nodes/localhostNode01/serverindex.xml).
I’m not sure if the WAS JMX support exposes this information – you’d have to check the doc.