Avinash Sridhar wrote:
this is regarding a certain problem that I am facing and not able to find an answer to it. As the case is,I am using tomcat 5.0.16 on Windows Xp home edition.I have made a directory as sampleapp in the CATALINA_HOME/webapps directory. the directory structure is as follows,in the sampleapp directory,I have the WEB-INF folder and this contains the classes and the lib directory,in the classes directory I have put the classes files as required. I have writen a web.xml file for the various mappings that need to be done. I havent tried anything with the CATALINA_HOME/conf/server.xml file.I am not sure as to what has to be done. As far as I can see the <Context> tag is commented and this needs to be changed for sure. I am unable to get a working solution to this problem,any leads would be very helpful.
I think the best solution to "just get going" would be to package your webapp in a .war file using the sdk's jar command and just drop that into tomcat's webapps directory. The auto-deployer will take care of the rest.
If you need special configuration for your application or you do not want to use autodeploy, you will have to edit server.xml and add a <Context>-Element for your application to it. You should refer to the tomcat administration documentation available at the tomcat project homepage.
In general, it should look seomthing like this:
--8<-----
<Context path="where_app_will_be_mapped_relative_to_docroot"
docBase="/dir_below_webapps_where_the_app_lives"
reloadable="true" or "false"
crossContext="true" or "false"><!-- if you want, you can define JNDI resources here, too: -->
<Resource name="jdbc/example_db"
auth="Container"
type="javax.sql.DataSource"/><ResourceParams name="jdbc/example_db">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>username</name>
<value>jspuser</value>
</parameter>
<parameter>
<name>password</name>
<value>jsppass</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value> <!-- if using MySQL -->
</parameter>
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/db_warthog_accounts</value>
</parameter></Context>
--8<-----
HTH
Phil
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
