applicationContext.xml

<!-- test环境 -->
<beans profile="test"> <context:property-placeholder ignore-unresolvable="true"
location="classpath*:config/jdbc.test.properties" /> <!--阿里巴巴druid,高效、功能强大、可扩展性好,便于sql监控分析-->
<bean id="mysqlDataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<!-- 配置初始化大小、最小、最大 -->
<property name="initialSize" value="5" />
<property name="minIdle" value="5" />
<property name="maxActive" value="20" />
<!-- 配置获取连接等待超时的时间 -->
<property name="maxWait" value="60000" /> <!--打开PSCache,并且指定每个连接上PSCache的大小 ,Oracle,把poolPreparedStatements配置为true,mysql可以配置为false。分库分表较多的数据库,建议配置为false-->
<property name="poolPreparedStatements" value="false" />
<property name="maxPoolPreparedStatementPerConnectionSize" value="20" /> <!-- 开启Druid的监控统计功能 -->
<property name="filters" value="stat,config" />
<!-- 开启数据库密码解密-->
<property name="connectionProperties" value="config.decrypt=${jdbc.decrypt};config.decrypt.key=${jdbc.publickey}" />
</bean>
<!-- 数据源1配置, 使用Tomcat JDBC连接池 -->
<!-- <bean id="mysqlDataSource" class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close">
Connection Info
<property name="driverClassName" value="${jdbc.driver}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" /> Connection Pooling Info
<property name="maxActive" value="${jdbc.pool.maxActive}" />
<property name="maxIdle" value="${jdbc.pool.maxIdle}" />
<property name="minIdle" value="0" />
<property name="defaultAutoCommit" value="true" />
</bean> --> </beans>

web.xml

<context-param>
<param-name>spring.profiles.active</param-name>
<param-value>test</param-value>
</context-param>

ServletContextListener:

https://my.oschina.net/bayuanqian/blog/160073

HttpSessionListener:

http://blog.csdn.net/vastskyjoe/article/details/4152661

package com.test.listenner;

import javax.servlet.http.HttpSessionEvent;

import javax.servlet.http.HttpSessionListener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@Component
public class SessionListener implements HttpSessionListener {
private static final Logger log = LoggerFactory.getLogger(SessionListener.class); @Override
public void sessionCreated(HttpSessionEvent event) {
log.info("session["+event.getSession().getId()+"]生效...");
} @Override
public void sessionDestroyed(HttpSessionEvent event) { log.info("session["+event.getSession().getId()+"]失效...");
}
}

com.alibaba.druid.support.http.WebStatFilter

http://blog.csdn.net/lgh1117/article/details/48789927

阿里巴巴Sql监控

com.alibaba.druid.support.http.StatViewServlet

http://blog.csdn.net/supingemail/article/details/50809982

com.alibaba.druid.support.spring.stat.DruidStatInterceptor

http://blog.csdn.net/yinxiangbing/article/details/47905403

applicationContext.xml和web.xml的一些配置的更多相关文章

  1. Eclispe创建maven工程缺失web.xml报web.xml is missing and <failOnMissingWebXml> is set to true的错误

    Eclispe创建maven工程缺失web.xml报web.xml is missing and <failOnMissingWebXml> is set to true的错误,一看,还缺 ...

  2. SpringMVC 常用applicationContext.xml、web.xml、servlet-mvc.xml简单配置

    在进行学习配置文件之前,为了加深对框架的认识,简单的做了SSM框架的简单实验.然后画出listAll查询方法的整个过程的思维导图. 整个过程中的web.xml.SpringMVC.xml.applic ...

  3. SSM的XML和WEB.XML的配置

    显示层(handler/controller): request请求到springmvc的前端控制器,从处理器映射器找相应的handler(用@RequestMapping("  " ...

  4. springmvc.xml,context.xml和web.xml

    1:springmvc.xml配置要点 一般它主要配置Controller的组件扫描器和视图解析器 下为:springmvc.xml文件 <?xml version="1.0" ...

  5. 每天学会一点点(spring-mvc.xml与web.xml配置文件)

    1.spring-mvc.xml中拦截器的使用 首先在springMVC.xml配置如下代码: <!-- 拦截器 --> <mvc:interceptors> <bean ...

  6. pom.xml出现web.xml is missing and <failOnMissingWebXml> is set to true解决方案

    提示信息应该能看懂.也就是缺少了web.xml文件,<failOnMissingWebXml>被设置成true了. 搜索了一下,Stack Overflow上的答案解决了问题,分享一下. ...

  7. pom.xml中web.xml is missing and <failOnMissingWebXml> is set to true错误的解决

    .personSunflowerP { background: rgba(51, 153, 0, 0.66); border-bottom: 1px solid rgba(0, 102, 0, 1); ...

  8. struts2中struts.xml和web.xml文件解析及工作原理

    web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp ...

  9. SpringMVC 学习 八 SSM环境搭建(一) web.xml配置

    第一步:导入jar包 注意包的兼容性,以后采用maven会好很多 第二步:配置web.xml 在web.xml中,主要的配置内容有以下几点 (1)spring容器配置文件的位置 <!-- spr ...

随机推荐

  1. iOS- iPhone App 如何运营?

    在质量过硬的情况下,如何运营才能使APP冲上app store的推荐?如何获得公众认可?获得下载量? 睡前简单分享一下最近从书中.互联网中浏览到的一些信息,和自己的一点理解. 首先这个问题很大.就抛砖 ...

  2. Python生成字体

      Python version 2.7 required, which was not found in the registry 参考:http://www.cnblogs.com/min0208 ...

  3. Pycharm使用问题# 行号设置

    设置行号就很简单了,在Settings中找到Editor-Appearance,选中Show line numbers即可.

  4. 分方式缓存常用的一致性hash是什么原理

    分方式缓存常用的一致性hash是什么原理 一致性hash是用来解决什么问题的?先看一个场景有n个cache服务器,一个对象object映射到哪个cache上呢?可以采用通用方法计算object的has ...

  5. CSS实现垂直居中

    Hack技术就可以啊!所以在这里我还要啰嗦两句,CSS中的确是有vertical-align属性,但是它只对(X)HTML元素中拥有valign特性的元素才生效,例如表格元素中的<td>. ...

  6. [教程] 离线封装原版WIN7系统 100%纯净

    raymond 发表于 2015-11-28 18:54:15 https://www.itsk.com/thread-360376-1-4.html 对于之前我用母盘封装的系统,纯粹是为了体积而折腾 ...

  7. 怎么写jq插件?

    1.概述 先看看html代码 <ul id="catagory"> <li><a href="#">jQuery</a ...

  8. Laravel 5 数据库迁移文件示例

    php artisan make:migration create_stocks_table 在项目根目录执行上面的命令后,会在database/migrations目录下生成2016_06_03_1 ...

  9. [笔记]使用clearfix清除浮动

    转载自奶牛博客 .clearfix { *zoom: 1; } .clearfix:before, .clearfix:after { display: table; line-height: 0; ...

  10. js调用父窗口中的方法

    window.open调用父窗口中的方法 回调函数: function fun9(ex){ alert(ex); } 调用语句: window.open("RoomSelecter.htm? ...