Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the version for Tomcat in a servlet web.xml?

In the Tomcat manager web interface are different columns for data specified in the servlet. For instance the 'Display Name' column is filled with the value of the <display-name> tag in the web.xml. Another column specifies the version. How can I set this in the web.xml or WAR?

like image 666
Mnementh Avatar asked Dec 17 '12 12:12

Mnementh


2 Answers

The "version number" you are seeing there is shown when you are using Tomcat's parallel deployment feature.

If you want to see a version number in there, you'll have to re-name your WAR file to be context-name##version where version is any string that will be alphabetically-compared to other versions in order to choose the latest one.

You really need to read the documentation for parallel deployment before you start using it, otherwise you are likely to confuse yourself.

like image 190
Christopher Schultz Avatar answered Dec 18 '22 14:12

Christopher Schultz


web.xml does not contain a special tag to describe version of application. You can only declare application's version in optional description elements. For example, <display-name> tag. But it does not affect anything.

Just name your war file as myapp##1.7.3.war when building.

like image 28
kapandron Avatar answered Dec 18 '22 15:12

kapandron