tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bodycombe, Andrew" <>
Subject RE: Including port no in req.getServerName() output.
Date Tue, 12 Aug 2003 10:11:20 GMT
It may be better to use relative URLs (like '/shop/category.jsp') instead of
the complete URL.
This removes the need to hard-code your server name and port.

Alternatively, you could use

Note you may run into problems if you use SSL, because the http: will need
to change to https:

Hope this helps,

-----Original Message-----
From: Antony paul [] 
Sent: 12 August 2003 11:07
To: tomcat mail list
Subject: Including port no in req.getServerName() output.

    Is it possible to include the port no in the output of a call to
request.getServerName(). I have written all JSP and Servlets which dont use
the port no. The call is like this
http://<%=request.getServerName()%>/shop/category.jsp. Now there is a need
to change the port no of Tomcat. Is there any other way to change the JSP
and servlets to include the port no.

Antony Paul.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message