5

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?

1

3 Answers 3

4

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.

Sign up to request clarification or add additional context in comments.

Comments

3

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.

2 Comments

We have wars, that are named xyz-1.1.0.war. But in the version-column in 'manager/html' is shown: None specified. So automatically extracted from the WAR-name does not work. Also the name of the WAR directly reflects in the URL the webapp is available. For production the version is therefore not in the name.
Try to use xyz##1.1.0.war. The official documentation has such syntax of declaration of version in war file name.
1

I am using Tomcat 7 and it uses the version of the WAR file. I am not aware of anything in the web.xml that is used for this.

See the Tomcat documentation here.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.