jfinal中使用druid,怎么配置druid登录权限

RyanMiao 发布于 2015/05/26 10:57
阅读 376
收藏 0

如题,在jfinal中使用druid,sql数据直接就可以查看,想增加登录验证,百度到有在web.xml中

配置拦截器,这样确实可以

<!-- Druid,监控数据库,以及WEB访问连接信息 -->
	<!-- 参考: https://github.com/alibaba/druid/wiki/%E9%85%8D%E7%BD%AE_%E9%85%8D%E7%BD%AEWebStatFilter -->
	<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,*.jsp,/druid/*,/download/*</param-value>
		</init-param>
		<init-param>
			<param-name>sessionStatMaxCount</param-name>
			<param-value>2000</param-value>
		</init-param>
		<init-param>
	        <param-name>sessionStatEnable</param-name>
	        <param-value>true</param-value>
	    </init-param>
		<init-param>
	        <param-name>principalSessionName</param-name>
	        <param-value>session_user_key</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>
	<!-- 配置 Druid 监控信息显示页面 -->
	<servlet>
		<servlet-name>DruidStatView</servlet-name>
		<servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class>
		<init-param>
			<!-- 允许清空统计数据 -->
			<param-name>resetEnable</param-name>
			<param-value>true</param-value>
		</init-param>
		<init-param>
			<!-- 用户名 -->
			<param-name>loginUsername</param-name>
			<param-value>druid</param-value>
		</init-param>
		<init-param>
			<!-- 密码 -->
			<param-name>loginPassword</param-name>
			<param-value>druid</param-value>
		</init-param>
	</servlet>
	<servlet-mapping>
		<servlet-name>DruidStatView</servlet-name>
		<url-pattern>/druid/*</url-pattern>
	</servlet-mapping>



但是jfinal拦截所有请求了,jfinal如果想配置要怎么配置呢,

重新DruidStatViewHandler要怎么重写,我增加username=“druid”,没有用

加载中
返回顶部
顶部