Deploy multiple application-specific webapps in Tomcat from Eclipse

I have a Tomcat 7 server in Eclipse with two webapps a and b , and you need to figure out how to have tomcat application configuration files that work with Eclipse.

Now I want each webapp to configure a configuration file as described here: Apache Tomcat: several webapps . So I created a folder <TomcatDirectory>/conf/Catalina/localhostand placed there a.xmland b.xml. This works fine when I start Tomcat from the command line.

But , where should I put specific application configuration files a.xmland b.xmlwhen do I start Tomcat from eclipse?

I already tried to put files in Eclipse in <EclipseWorkspace>\Servers\<ServerName>\conf\Catalina\localhost\, but WTP does not copy these files to<EclipseWorkspace>\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost

+4
source share
3 answers

Leave them in <TomcatDirectory>/conf/Catalina/localhost

Server> Open> Server Locations

Edit from: Use workspace metadata To: Use Tomcat installation

Now a.xml and b.xml from will be used <TomcatDirectory>/conf/Catalina/localhost.

+3
source

If this is for development, you can specify the folder in the "docBase" attribute of the context file as follows:

<?xml version="1.0" encoding="UTF-8"?>
<Context crossContext="true" docBase="C:/devel/MyApp/web/target/MyApp-web" path="/MyApp" reloadable="true">
    <Resource
        ... />
</Context>

/conf/Catalina/localhost, , , tomcat , .

+1

, , context.xml . context.xml META-INF - (a b), context.xml. eclipse META-INF - WEB-INF.

0

All Articles