Simultaneous deployment of Java Servlet and Database Connection Pool

Source: Internet
Author: User
Title: simultaneous deployment of Java Servlet and Database Connection Pool

Keyword: servlet connection pool

Author: jrq

Body:

Test the web application environment: Win2k Pro + Tomcat 5.0

Pay attention to the deployment sequence of the servlet and connection pool in the web. xml file of the Web application.

In the Web. xml file, in the <web-app> tag, you must first write <servlet> and <servlet-mapping>, and then write <resource-ref>.
Otherwise, the context of the Web application cannot be started normally when Tomcat is started, and the Web application cannot be accessed normally.

A simple example of Web. xml deployed in both the servlet and connection pool is as follows:
---------------
<Web-app>
<Servlet>
<Servlet-Name> query </servlet-Name>
<Servlet-class> bookquery </servlet-class>
</Servlet>

<Servlet-mapping>
<Servlet-Name> query </servlet-Name>
<URL-pattern>/query </url-pattern>
</Servlet-mapping>

<Resource-ref>
<Description> access datasource example </description>
<Res-ref-Name> JDBC/access </RES-ref-Name>
<Res-type> javax. SQL. datasource </RES-type>
<Res-auth> container </RES-auth>
</Resource-ref>
</Web-app>
------------------

by jrq
2004.11.30 in Shi

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.