How to Override Java Container URL Mappings for Deployed Applications

If I have a WAR called my-web-app.war, and I am deploying it to the Tomcat directory webapps/, assuming it starts correctly, I could access it by pointing my browser to:

http://localhost/my-web-app

Similarly, if I have an EAR called my-server-app.ear, and I deploy it to the GlassFish directory domain/autodeploy/, and provided that it starts correctly, I could access it by pointing to my browser at:

http://localhost/my-server-app

But what if I want to keep my WAR / EAR with the same name, but deploy it to URLs other than these default values. For instance:

  • Do my-web-app.warexpand ashttp://localhost/webapp
  • Do my-server-app.warexpand ashttp://localhost/srvapp
  • Create my-server-app.waras easyhttp://localhost

, Apache, , " " .., http://example.com/some/long/path/to/file.html http://example.com/file , Tomcat/GlassFish ( , )?

, WAR/EAR, , , , :

  • my-web-app-3.17.2.war ..

http://localhost/my-web-app-3.17.2 .

+3
2

Tomcat , - .

WAR - :

webapp##my-web-app-3.17.2.war

/webapp

, ## . . docs.

+3

EAR, application.xml

+1

All Articles