You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dave Solecki <ga...@excite.com> on 2001/08/13 15:28:57 UTC

Get Server IP in a JSP

Hi all,
     I know this isn't really a question about Tomcat, but I figured that
since Tomcat is all about Servlets and JSP's someone may be able to answer
my question.  Is there a way to query the server for it's IP address within
and JSP or Servlet?  This would be on a Windows machine.  If there is can
that IP address be written into a URL Rewrite?  I'm writing an Equipment
management system for work and it is all written in JSP.  My problem is that
the machine I'm using as my Tomcat server is my Workstation.  I'd like to
move it to a dedicated machine, but our Workstations do not have DNS, so
typing in the machine mane does not work.  I have to hard code in my IP
address in order for the system to function.  The problem with that is that
we have Dynamic IP addresses.  Mine hasn't changed in a long time, but it
could and if it does the whole system won't work.

Could anyone offer a suggestion to my IP address problem?

Thanks, 

Dave





_______________________________________________________
Send a cool gift with your E-Card
http://www.bluemountain.com/giftcenter/



Re: Get Server IP in a JSP

Posted by Kyle Wayne Kelly <kk...@bellsouth.net>.
You could use ipconfig to create a file that contains the IP address.

Kyle Wayne Kelly
(504)391-3985
http://www.cs.uno.edu/~kkelly
----- Original Message -----
From: "Dave Solecki" <ga...@excite.com>
To: "List, Tomcat" <to...@jakarta.apache.org>
Sent: Monday, August 13, 2001 6:28 AM
Subject: Get Server IP in a JSP


>
> Hi all,
>      I know this isn't really a question about Tomcat, but I figured that
> since Tomcat is all about Servlets and JSP's someone may be able to answer
> my question.  Is there a way to query the server for it's IP address
within
> and JSP or Servlet?  This would be on a Windows machine.  If there is can
> that IP address be written into a URL Rewrite?  I'm writing an Equipment
> management system for work and it is all written in JSP.  My problem is
that
> the machine I'm using as my Tomcat server is my Workstation.  I'd like to
> move it to a dedicated machine, but our Workstations do not have DNS, so
> typing in the machine mane does not work.  I have to hard code in my IP
> address in order for the system to function.  The problem with that is
that
> we have Dynamic IP addresses.  Mine hasn't changed in a long time, but it
> could and if it does the whole system won't work.
>
> Could anyone offer a suggestion to my IP address problem?
>
> Thanks,
>
> Dave
>
>
>
>
>
> _______________________________________________________
> Send a cool gift with your E-Card
> http://www.bluemountain.com/giftcenter/
>
>