Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ web application context path

In my IntelliJ web app, I have set the application context to myapp as shown below

enter image description here

When I set the Application context, it doesn't seem to have any effect. I was expecting the app to be deployed to myapp, or at least the generated context.xml file to set my app's context to myapp. Any thoughts on why this doesn't work (does it have something to do with the fact that this is an exploded war)?

like image 470
Jeff Storey Avatar asked Dec 11 '12 00:12

Jeff Storey


People also ask

Where is context path in web application?

The typical way of getting the context path is through the HttpServletRequest class. Simply you can add a HttpServletRequest parameter to your controller method and then get the context path using getContextPath() method. Now that you get the context path, you can pass it to the services that need it.

How do I change the context path of a web application?

To change the context root of a web application that is already available in the Eclipse workspace, simply right-click on the web project and call the “Properties” action from the context menu.

What is context path in Java web application?

The context path is the portion of the request URI that is used to select the context of the request. The context path always comes first in a request URI. The path starts with a "/" character but does not end with a "/" character. For servlets in the default (root) context, this method returns "".


1 Answers

Overriding CATALINA_BASE in Tomcat startup script may break IDEA deployment as it works by supplying custom CATALINA_BASE location where the modified configuration is placed so that Tomcat loads artifacts directly from the location specified as the artifact output directory.

See the related question:

  • How is Tomcat handled by IntelliJ IDEA 10.5
like image 196
CrazyCoder Avatar answered Sep 23 '22 22:09

CrazyCoder