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?

Tom K

2004-09-17

Replies:

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)
Karr, David
Sent: Friday, September 17, 2004 11:25 AM
To: SERVLET-INTEREST@(protected)
Subject: General strategy for determining current server, or specific
for WebLogic?

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)
body
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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.764 / Virus Database: 511 - Release Date: 9/15/2004


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.764 / Virus Database: 511 - Release Date: 9/15/2004

___________________________________________________________________________
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.