Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change eclipse's built in tomcat context.xml file using WTP?

Tags:

eclipse

tomcat

Is it possible somehow to modify the contents of the context.xml that eclipse uses when you are doing "Run as" -> "On server"... and "Debug as" -> "on server"

We have some settings that are in our production environments context.xml file and we need them to be available to eclipse built in tomcat as well.

I know we could use eclipse to run run on an external server, but thats not as convenient.

like image 316
Jay Avatar asked Jul 20 '11 08:07

Jay


People also ask

Where is Tomcat context xml?

context. xml file is the application deployment descriptor for the Apache Tomcat server. In a deployed application, this file is located in the META-INF folder of the web application directory or the WAR file, for example, tomcat/webapps/app-core/META-INF/context.

Where do I put the context path in server xml?

xml. The second option is to set the context path of the application in the server. xml (which is located at $CATALINA_HOME\conf). Note: defining the context path manually has the side effect that the application is deployed twice by default: at http://localhost:8080/ExampleApp/ as well as at http://localhost:8080/.


1 Answers

Have a look at the automatically created project "Servers". There should be a folder for each configured Server. There, open the context.xml and add anything you like to be in the "default" context (Parameter-Tags for example).

Anything that's inside there will be used to populate the context.xml WTP automatically creates on publishing for each project on that Server.

Or use the project specific way: put a context.xml with your contents inside META-INF in your project (have a look here: http://wiki.eclipse.org/WTP_Tomcat_FAQ#How_do_I_specify_the_Tomcat_context_configuration_for_my_Web_Application.3F)

like image 130
Daniel Avatar answered Oct 07 '22 08:10

Daniel