FlexServer 发布模式 整合Druid

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


	<!-- ##################### Druid Filter Monitor start #################### -->
	<filter>
		<filter-name>DruidWebStatFilter</filter-name>
		<filter-class>com.alibaba.druid.support.http.WebStatFilter</filter-class>
		<init-param>
			<param-name>exclusions</param-name>
			<param-value>*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*</param-value>
		</init-param>
		<init-param>
			<param-name>profileEnable</param-name>
			<param-value>true</param-value>
		</init-param>
	</filter>
	<filter-mapping>
		<filter-name>DruidWebStatFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	<servlet>
		<servlet-name>DruidStatView</servlet-name>
		<servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>DruidStatView</servlet-name>
		<url-pattern>/druid/*</url-pattern>
	</servlet-mapping>
	<!-- ##################### Druid Filter Monitor end #################### -->


	<filter>
		<filter-name>LhdFilter</filter-name>
		<filter-class>com.lhd.core.ServerFilter</filter-class>
		<init-param>
			<param-name>configClass</param-name>
			<param-value>com.lhd.framework.config.LhdConfig</param-value>
		</init-param>
	</filter>
	<filter-mapping>
		<filter-name>LhdFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

	<welcome-file-list>
		<welcome-file>login.jsp</welcome-file>
	</welcome-file-list>
</web-app>

PS:ServerFilter会拦截所有请求,/druid 。但如果请求中包含".",则会直接chain.doFilter(request, response);所以可以访问druid.index.html。同理配置loginUsername和loginPassword后登录也会被拦截。

==============================================================================

context中Resource如下:
<Resource name="jdbc/FlexServer" 
		factory="com.alibaba.druid.pool.DruidDataSourceFactory"
		auth="Container" 
		type="javax.sql.DataSource" 
		filters="stat" 
		
		maxActive="100"
		maxIdle="30" 
		maxWait="10000" 
		username="username" 
		password="password"
		url="jdbc:oracle:thin:@10.201.2.224:1521:orcl" />

devMode = false
jndiName = java:comp/env/jdbc/FlexServer

你可能感兴趣的:(druid,jFinal)