The ports Tomcat uses are set on startup from the server.xml file, if you want to change ports you have to restart Tomcat. Why would you want to change ports dynamically? You can have multiple instances of Tomcat running on the same machine if you assign them different ports.
Actually, I want to start Tomcat using a script. Before starting tomcat in a port, I want to check whether someother application or someother tomcat itself is running on that port. If some application is running on that port, I can start Tomcat in a different free port.
So, is there a way to dynamically set Tomcat port, before starting it?
Thanks and regards, Jaffer.
"He owns Pan-Am. He owns Congress. He owns the Civil Aeronautics Board. But he does not own the sky." (Howard Hughes in 'The Aviator').