File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tomcat port

 
shobhit garg
Ranch Hand
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .

Thanks
Shobhit
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic