This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

tomcat port  RSS feed

 
shobhit garg
Ranch Hand
Posts: 42
  • 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
  • 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
Boost this thread!