Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Servlet Interest »

Re: General strategy for determining current server, or specific for WebLogic?

Karr, David

2004-09-17


Bingo. That looks good. I forgot about that.

> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's
> Java Servlet API Technology.
>
> How about InetAddress.getLocalHost().getHostName()
>  (*Chris*)
>
> Original Message -----------------------
> Because I don't have a request. The mbean is registered from
> a "load-on-startup" servlet. The registration happens in the
> "init()" method of the servlet.
>
> > -----Original Message-----
> > From: A mailing list for discussion about Sun Microsystem's Java
> > Servlet API Technology. [mailto:SERVLET-INTEREST@(protected)
> > Behalf Of Chris Pratt
> >
> > Is there a reason you're not just using request.getServerName()?
> >  (*Chris*)
> >
> > Original Message -----------------------
> > David,
> >
> >      One way you could determine the server it is
> running on is to
> > us the IP address. You could do this in a servlet of jsp. If this
> > example doesn't go deep enough (actually getting the IP
> address or web
> > address) ... you get the concept?
> >
> > String PREURI =
> > request.getContextPath()+request.getServletPath().substring(0,
> > request.ge
> > tServletPath().lastIndexOf("/"));
> >
> > Tom Kochanowicz
> >
> >
> > -----Original Message-----
> > From: A mailing list for discussion about Sun Microsystem's Java
> > Servlet API Technology. [mailto:SERVLET-INTEREST@(protected)
> > Behalf Of Karr, David
> >
> > I have a situation where an mbean needs to determine what
> server it is
> > running on. The mbean is registered from a servlet. This
> application
> > is running on WebLogic 8.1. I would have thought this was
> simple, but
> > I can't figure out any way in the mbean or the servlet to determine
> > the name of the host the code is running in. Is anyone aware of a
> > general way to do this, or anything specific to WebLogic?

___________________________________________________________________________
To unsubscribe, send email to listserv@(protected)
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
©2008 junlu.com - Jax Systems, LLC, U.S.A.