Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the "source" attribute of the Context element of an Apache Tomcat configuration file for?

It's somehow related to Eclipse. For example:

<Host>
    <Context docBase="foo" path="/foo" reloadable="true"
        source="org.eclipse.jst.j2ee.server:foo" />
</Host>
like image 486
regjo Avatar asked Feb 03 '10 23:02

regjo


People also ask

What is a context in Tomcat?

What is a Tomcat Context. In Tomcat, the Context Container represents a single web application running within a given instance of Tomcat. A web site is made up of one or more Contexts. For each explicitly configured web application, there should be one context element either in server.

What is the Apache Tomcat main configuration file name?

XML. The server. xml file is Tomcat's main configuration file, and is responsible for specifying Tomcat's initial configuration on startup as well as defining the way and order in which Tomcat boots and builds.

What is context path in Tomcat?

The context path refers to the location relative to the server's address which represents the name of the web application. By default, Tomcat derives it from the name of the deployed war-file. So if we deploy a file ExampleApp. war, it will be available at http://localhost:8080/ExampleApp.

Where is Apache Tomcat configuration file?

The main Apache Tomcat configuration file is at /opt/bitnami/tomcat/conf/server. xml. Once Apache Tomcat starts, it will create several log files in the /opt/bitnami/tomcat/logs directory. The main log file is the catalina.


1 Answers

Eclipse WTP adds the source attribute to the project-related <Context> element to identify the location of the source code associated with the context (thus, the actual project in the workspace which has been deployed to this server from inside Eclipse).

If you wondered about this due to a warning during Tomcat's startup, since Tomcat 6.0.16 any "unrecognized" XML tags and attributes in the context.xml or server.xml will produce a warning about it during the startup, although there's actually no means of a DTD.

Just ignore it. Tomcat shall work fine and Eclipse is happy with it. It won't occur in real production environment with a worthfully WAR file.

like image 130
BalusC Avatar answered Oct 18 '22 11:10

BalusC