日期:2014-05-20  浏览次数:20791 次

spring的JDBCTemplate与proxool一起使用时该怎样进行配置
只使用spring,连接池proxool
web.xml,spring-servlet.xml,proxool.xml,applicationContext.xml都放在WEB-INF下。
web.xml配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee   http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
 <welcome-file-list>
  <welcome-file>index.jsp</welcome-file>    
 </welcome-file-list>       
   
 <!--  DB连接池管理 -->           
 <servlet>
  <servlet-name>ServletConfigurator</servlet-name>
  <servlet-class>
   org.logicalcobwebs.proxool.configuration.ServletConfigurator
  </servlet-class>
  <init-param>
   <param-name>xmlFile</param-name>
   <param-value>WEB-INF/proxool.xml</param-value>
  </init-param>
  <load-on-startup>1</load-on-startup>
 </servlet>
 <!--  连接线程池监控-->
 <servlet>
  <servlet-name>admin</servlet-name>
  <servlet-class>
   org.logicalcobwebs.proxool.admin.servlet.AdminServlet
  </servlet-class>
 </servlet>
 <servlet-mapping>
  <servlet-name>admin</servlet-name>
  <url-pattern>/admin</url-pattern>
 </servlet-mapping>
 
 <!-- Spring MVC配置 --> 
 <servlet>  
     <servlet-name>spring</servlet-name>  
     <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>  
     <init-param>  
         <param-name>contextConfigLocation</param-name>  
         <param-value>/WEB-INF/spring-servlet.xml</param-value>  
     </init-param>  
     <load-on-startup>1</load-on-startup>  
 </servlet>  

 <servlet-mapping>  
     <servlet-name>spring</servlet-name>  
     <url-pattern>*.do</url-pattern>  
 </servlet-mapping>  

 <!-- Spring配置 --> 
 <listener>  
     <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>  
 </listener>  

 <!-- 指定Spring Bean的配置文件所在目录。默认配置在WEB-INF目录下 --> 
<context-param>
     <param-name>contextConfigLocation</param-name>  
     <param-value>/WEB-INF/applicationContext.xml</param-value>  
 </context-param> 
 
</web-app>

spring-servlet.xml配置如下:
<?xml version="1.0" encoding="UTF-8"?>
  <beans xmlns="http://www.springframework.org/schema/beans"  
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"