Re: Struts & Mysql - can't get to server.xml must put in struts-config
Posted by: will crick
Date: March 07, 2005 09:51AM

wes,

You can also configure data sources and connection pooling in an .xml file with the same name as your application. This is then put in the tomcat/web-apps/ folder and is read on start up of Tomcat. This means you dont have to edit to tomcat server.xml file but you will need access to the web-apps folder of tomcat.

The info to put in the .xml file is exactly the same as you would have in server.xml and you wont need to change any application code!!!

Hope this helps...

e.g.

Application context = /test
config file name = test.xml

Within the config file:
<Context path="/test" docBase="test.war" debug="0" reloadable="true" crossContext="true">

<!-- JDBC resource params for database-->
<Resource name="jdbc/testdb" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/finditgreen_register">
<parameter>
<name>username</name>
<value>testuser</value>
</parameter>
<parameter>
<name>password</name>
<value>password</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:mysql://host/dbname</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
</ResourceParams>
</Context>

Options: ReplyQuote


Subject
Written By
Posted
Re: Struts & Mysql - can't get to server.xml must put in struts-config
March 07, 2005 09:51AM
March 30, 2005 06:26AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.