You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Lin, Zhongwu" <zh...@citigroup.com> on 2003/05/21 18:22:02 UTC

port number

HI,

How do I get the port number that the tomcat is listening to from servlet? 

I have a servlet that receives xml document then parse it. In order to parse
it with schema I need to tell parser the location of the msg.xsd which is
located in 

  http://localhost:8080/myapp/msg.xsd

I uses the request.getServerPort() to get the port number (8080) to
construct the url. This works fine when the application is running on tomcat
standalone. 

But when I access my servlet from IIS server then  request.getServerPort()
returns 80 instead of 8080 so the url:

  http://localhost:80/myapp/msg.xsd

is invalid and the parser complained that it can't find msg.xsd. so How do I
get the right port number so that I can construct the right url to instruct
parser to get my schema?

thanks

John
      

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org