Tuesday, June 20, 2006

tomcat 5.x onwards - context element

There are probably tons of documentations available on tomcat's site regarding the basic configuration of Tomcat.

One major change you may want to take note (and the documents seems to miss out on that) is that :
  • the <context> element does not exist in server.xml anymore.
    you can either:
    • create a context.xml document in your web app's META-INF folder. (yes, create a META-INF) folder
    • or under the /conf/Catalina/localhost folder, create a .xml
I will recommend the first method... seems neater
An e.g of context.xml

<context path="/test" docbase="${catalina.home}/webapps/test">

<!-- Link to the Datasource declared in the server.xml -->
<resourcelink name="jdbc/rhymesdb" global="rhymesdb"
type="javax.sql.DataSource">

</resourcelink>


I will talk about creating of datasources later

0 Comments:

Post a Comment

<< Home