数据源配置及web.xml

--------------------------------------oracle-------------------------------tomcat7----------------------------

<Context docBase="XJFocus" path="/XJFocus" reloadable="true"
source="org.eclipse.jst.j2ee.server:XJFocus">
<Resource driverClassName="oracle.jdbc.driver.OracleDriver"
maxActive="10" maxIdle="2" maxWait="5000" name="crawl"
password="dews" type="javax.sql.DataSource" url="jdbc:oracle:thin:@192.168.3.102:1521:orcl"
username="dews" />
</Context>

--------------------------------------------------web.xml--------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>xjfocus</display-name>


<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
</filter>




<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>


<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath*:/config/oracle/*.xml,classpath*:/config/*.xml
</param-value>
</context-param>


<!-- 缓存配置 -->


<!-- struts2配置 -->
<filter>
<filter-name>struts-prepare</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
</filter>


<filter>
<filter-name>struts-execute</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter</filter-class>
</filter>


<filter-mapping>
<filter-name>struts-prepare</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>


<filter-mapping>
<filter-name>struts-execute</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>


<!-- 资源访问配置 -->
<filter>
<filter-name>resource</filter-name>
<filter-class>net.optix.common.filter.ResourceFilter</filter-class>
</filter>


<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>


<!-- <filter-mapping> <filter-name>CacheFilter</filter-name> <url-pattern>*.action</url-pattern> 
</filter-mapping> -->


<filter-mapping>
<filter-name>resource</filter-name>
<url-pattern>/resource/*</url-pattern>
</filter-mapping>






<resource-ref>
<res-ref-name>crawl</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>




</web-app>

posted on 2014-05-05 17:44  _故乡的原风景  阅读(241)  评论(0编辑  收藏  举报