Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programmatically determine servlet container port etc. 1

Status
Not open for further replies.

microserf

Programmer
Oct 18, 2005
12
GB
Hi

I am writing a custom JSP tag and I need to be able to determine how the servlet container is configured. Specifically, I want to be able to do things like get a list of the port numbers in use and which schemes they are using (e.g. HTTPS on port 8443).

Is this possible?

I know I can manually read my server.xml file or whatever, but I need the JSP tag to be able to ask the servlet container.

Your help would be appreciated.

C
 
You could use HttpServletRequest.getServerPort() .

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Thanks, but using HttpServletRequest.getServerPort() would only tell me the port number that the request was using. It would not tell me about all of the ports that are configured, which is what I want.
 
No way of doing that using the standard servlet or JSP APIs.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top