For Programmers: Free Programming Magazines  


Home > Archive > Java Beans > May 2006 > [tomcat] Get the HTTP port (with a mbean ?)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author [tomcat] Get the HTTP port (with a mbean ?)
Seb

2006-05-13, 7:00 pm

Hello,

I need to dynamically get, in java code, HTTP port used by Tomcat.
I think I should use a "mbean", but I don't exactly know how to do.
My application run under a JBoss 3.2.2 application server.

Thanks for your help,

Sebastien
Wretched Excess

2006-05-13, 10:00 pm


"Seb" <arx9qekubvq93e3@jetabe.net> wrote in message
news:IJm9g.142$cU6.153@nntpserver.swip.net...
> Hello,
>
> I need to dynamically get, in java code, HTTP port used by Tomcat.
> I think I should use a "mbean", but I don't exactly know how to do.
> My application run under a JBoss 3.2.2 application server.
>
> Thanks for your help,
>
> Sebastien



Class HttpUtils


public static java.lang.StringBuffer getRequestURL(HttpServletRequest
req)

Reconstructs the URL the client used to make the request, using information
in the HttpServletRequest object. The returned URL contains a protocol,
server name, port number, and server path, but it does not include query
string parameters.






Andy Flowers

2006-05-14, 4:00 am

Seb wrote:
> Hello,
>
> I need to dynamically get, in java code, HTTP port used by Tomcat.
> I think I should use a "mbean", but I don't exactly know how to do.
> My application run under a JBoss 3.2.2 application server.
>
> Thanks for your help,
>
> SebastienPort


For a request you've received, take a look at HttpServletRequest.getServer();
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com