wood burning stoves 2.0*
The moose likes Tomcat and the fly likes tomcat port Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "tomcat port " Watch "tomcat port " New topic

tomcat port

shobhit garg
Ranch Hand

Joined: Mar 07, 2004
Posts: 42
Hi ,
How can we programatically decide on which port to run tomcat.
I don't want to modify the server.xml but want to do it through
java code .

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Tomcat binds to the port specified in server.xml when it starts up.
Webapplications are not loaded until Tomcat has started.

This means that it is not possible to change this setting from within your webapp.

Tomcat is an open source project so you are free to download and modify the actual Tomcat source code if you want to change it's default behavior.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
It is sorta covered in the JavaRanch Style Guide.
subject: tomcat port
Similar Threads
Dynamic Setting of Server Port in Tomcat
mapping default page to domain name in tomcat without port number.in Ubuntu
Apache + Tomcat Configuration Problem
Query about 'Port' Number??