Not sure if you got a response to this, but this has worked for myself.


<%@ page import="java.net.InetAddress" %>

<%

    InetAddress ia = InetAddress.getLocalHost();
    out.println("<!-- hostname  " + ia.getHostName() +  " -->");
%>





----- Original Message -----
From: "David Goodenough" <[EMAIL PROTECTED]>
To: <tomcat-user@jakarta.apache.org>
Sent: Friday, May 12, 2006 8:19 AM
Subject: How to embed server hostname in JSP page on clustered Tomcat


> I have a cluster of (currently) two Tomcat 5.5.17 instances.  I want to
put a
> hidden field on the pages which tells me which machine I am currently
> connected to.  Reading the spec it appeared that using:-
>
> <input type="hidden" name="host" value="${pageContext.request.serverName}"
/>
>
> should work, but it would appear that all this does is take the server
portion
> of the URL.
>
> Anyone know how to do this (short of writing some Java code that is, I
would
> rather use simple JSP and JSTL).
>
> David
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to