Configuration Resources often need to be stored with your web application. These are consumed either by your application server, or libraries in your application (such as Hibernate).
- These locations are based on using a directory structure generated by Maven Tapestry 5 Archetype. At the time of this writing, this is the typical way to start working on a Tapestry 5 project. If your structure looks different, you will need to make changes accordingly.
- Things that can go in
- src/main/resources
- hibernate.cfg.xml or hibernate.properties when using Hibernate.
- log4j.properties when using Log4J as your logger.
- applicationContext.xml, when using Spring. (can also go in web.xml)
- applicationContext-acegisecurity.xml, when using Spring to configure Acegi. (can also go in web.xml)
- src/main/resources
- Things that can go in
- src/main/webapp/META-INF
- context.xml, as used for Tomcat. In here you can put your JNDI resource settings as referenced in your web.xml. These will get appended to the server.xml file in the %Tomcat_Home%/conf directory. If you want a different context.xml for different servers you deploy to, keep reading.
- src/main/webapp/META-INF
- Things that can go in
- src/main/webapp/WEB-INF
- web.xml, as used by web application containers (Tomcat/Jetty, etc) In here you can put your context parameters, filters and filter mappings, and JNDI resource references.
- app.properties, the application wide message catalog. Use this for defining the labels for buttons, field labels and more.
- src/main/webapp/WEB-INF
- Different Context.xmls for different servers
- For Tomcat 5+ it is not recommended to put contextual information in the %Tomcat_Home%/conf/server.xml Instead, you should create a separate context.xml and place it in %Tomcat_Home%/conf/context.xml In some cases (Such as Eclipse Ganymede), the "%Tomcat_Home%/conf/context.xml" will get overwritten on deployment, if you are deploying straight to the Tomcat installation. So it is actually preferable to put the contents of context.xml into a file
- "%Tomcat_Home%\conf\Catalina\localhost\context.xml.default"
- For Tomcat 5+ it is not recommended to put contextual information in the %Tomcat_Home%/conf/server.xml Instead, you should create a separate context.xml and place it in %Tomcat_Home%/conf/context.xml In some cases (Such as Eclipse Ganymede), the "%Tomcat_Home%/conf/context.xml" will get overwritten on deployment, if you are deploying straight to the Tomcat installation. So it is actually preferable to put the contents of context.xml into a file