If I have a WAR called my-web-app.war and I deploy it to Tomcat's webapps/ directory, assuming it starts up correctly, I could access it by pointing my browser at:

http://localhost/my-web-app

Likewise, if I have an EAR called my-server-app.ear and I deploy it to GlassFish's domain/autodeploy/ directory, then also assuming it starts up correctly, I could access it by pointing my browser at:

http://localhost/my-server-app

But what if I want to keep my WAR/EAR with the same name, but have it deploy to URLs that are different than these defaults. For example:

Make my-web-app.war deploy as http://localhost/webapp

Make my-server-app.war deploy as http://localhost/srvapp

Make my-server-app.war deploy as just http://localhost

In other servers like Apache I know it is possible to setup "virtual directories", etc., so that http://example.com/some/long/path/to/file.html displays in the browser as http://example.com/file, and was wondering if Tomcat/GlassFish allow this (and if so, how)?

I ask because I intend to have the versions of all my WARs/EARs included with their names, so I can look at them on the file system and instantly know what version they are, like:

my-web-app-3.17.2.war, etc.

And making my users go to http://localhost/my-web-app-3.17.2 seems a little crazy.