码迷,mamicode.com
首页 > 其他好文 > 详细

aaaa

时间:2016-08-23 23:37:20      阅读:283      评论:0      收藏:0      [点我收藏+]

标签:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cn.gszhang</groupId>
<artifactId>gszhang</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>

<properties>
<!-- 主要依赖库的版本定义 -->
<spring.version>3.2.4.RELEASE</spring.version>
<mybatis.version>3.2.2</mybatis.version>
<activemq.version>5.5.1</activemq.version>
<quartz.version>1.8.4</quartz.version>
<servlet.version>2.5</servlet.version>
<slf4j.version>1.7.5</slf4j.version>
<logback.version>1.0.13</logback.version>
<jsp.version>2.1</jsp.version>
<jdk.version>1.7</jdk.version>
</properties>

<!-- LOGGING begin -->
<dependencies>
<!-- slf4j -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>

<!-- logback-->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<!-- LOGGING end -->

<dependency>
<groupId>org.tuckey</groupId>
<artifactId>urlrewrite</artifactId>
<version>2.5.2</version>
</dependency>

<!-- XML begin -->
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
<exclusion>
<groupId>stax</groupId>
<artifactId>stax-api</artifactId>
</exclusion>
<exclusion>
<groupId>stax</groupId>
<artifactId>stax-ri</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- XML end -->

<!-- EXCEL begin -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.9</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- EXCEL end -->

<!-- GENERAL UTILS begin -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.2</version>
</dependency>

<!-- SPRING basic begin -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
<exclusions>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>


<!-- jms begin -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-all</artifactId>
<version>5.5.1.MF</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>kahadb</artifactId>
<version>${activemq.version}</version>
</dependency>
<!-- jms end -->

<dependency>
<groupId>org.directwebremoting</groupId>
<artifactId>dwr</artifactId>
<version>3.0.RC2</version>
</dependency>

<!-- CACHE begin -->
<!-- memcached -->
<dependency>
<groupId>com.googlecode.xmemcached</groupId>
<artifactId>xmemcached</artifactId>
<version>1.4.2</version>
</dependency>

<!---ehcache-->
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>1.6.2</version>
</dependency>
<!-- CACHE end -->

<!--bouncycastle-->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bouncycastle</artifactId>
<version>1.1</version>
</dependency>



<!-- security start -->
<dependency>
<groupId>com.octo.captcha</groupId>
<artifactId>jcaptcha</artifactId>
<version>1.0</version>
</dependency>
<!-- security end -->

<!-- email/scheduler/freemarker -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- SPRING basic end -->

<!-- AOP begin-->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.6.9</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>2.2</version>
</dependency>
<!-- AOP end -->


<!-- PERSISTENCE begin -->
<!-- mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>${mybatis.version}</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.3</version>
</dependency>

<!-- spring orm -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>

<!-- optional datasource pool -->
<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.2.1</version>
</dependency>

<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>1.5.4</version>
</dependency>
<!-- PERSISTENCE end -->


<!-- spring web -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>

<!-- JSON -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>

<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.8</version>
</dependency>




<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>


<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>${servlet.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>${jsp.version}</version>
</dependency>

<!-- timer-->
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>${quartz.version}</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<!-- compiler插件, 设定JDK版本 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
<showWarnings>true</showWarnings>
</configuration>
</plugin>

<!-- clean插件 -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
</plugin>

<!-- war打包插件, 设定war包名称不带版本号 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<warName>${project.artifactId}</warName>
</configuration>
</plugin>

<!-- jar打包相关插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<finalName>${project.artifactId}</finalName>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
<!-- resource插件 -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
</plugin>

<!-- dependency相关插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
</plugin>

<!-- test插件, 仅测试名称为*Test的类-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.4</version>
</plugin>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>

</plugins>
</pluginManagement>
<finalName>gszhang</finalName>
</build>

</project>

 

 

<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="5 seconds">

<property name="log.base" value="/logs/gszhang/gszhang"/>

<!-- Console stdout -->
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%-20(%d{HH:mm:ss.SSS} [%thread]) %-5level %logger{80} - %msg%n</pattern>
</encoder>
</appender>

<!--#INFO Appender (Store info message, rolling with daily,The default log for 30 days) -->
<appender name="RollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>INFO</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.base}.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{HH:mm:ss.SSS} %-4relative [%thread] %-5level %logger{80} - %msg%n</pattern>
</encoder>
</appender>

<!--#ERROR Appender (Store error message, rolling with daily,The default log for 30 days) -->
<appender name="ErrorRollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.base}-error.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{HH:mm:ss.SSS} %-4relative [%thread] %-5level %logger{80} - %msg%n</pattern>
</encoder>
</appender>

<!--#TraceFile Appender (Store debug message, rolling with 100M, 10 files, threshold is OFF)-->
<appender name="TraceRollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.base}-trace.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${log.base}-trace%i.log.zip</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>10</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>100MB</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%date %-4relative [%thread] %-5level %logger{80} - %msg%n</pattern>
</encoder>
</appender>

<appender name="RecoredLoginErrorFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.base}-loginError.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${log.base}-loginError%i.log.zip</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>10</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>100MB</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%date %-4relative [%thread] %-5level %logger{80} - %msg%n</pattern>
</encoder>
</appender>

<!--Application log is appended to the RollingFile,The default level is INFO-->
<logger name="cn.gszhang">
<appender-ref ref="RollingFile"/>
</logger>

<!--Application log is appended to the ErrorRollingFile,The default level is ERROR-->
<logger name="cn.gszhang">
<appender-ref ref="ErrorRollingFile"/>
</logger>

<logger name="net.rubyeye.xmemcached" level="warn">
<appender-ref ref="RollingFile"/>
</logger>

<logger name="com.google.code.yanf4j" level="warn">
<appender-ref ref="RollingFile"/>
</logger>

<logger name="org.apache.activemq" level="warn">
<appender-ref ref="RollingFile"/>
</logger>

<!--Application log is appended to the Console and TraceRollingFile,The default level is ERROR-->
<!-- <root level="DEBUG"> -->
<root level="INFO">
<appender-ref ref="stdout"/>
<appender-ref ref="TraceRollingFile"/>
</root>
</configuration>

 

<?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>gszhang</display-name>
<filter>
<filter-name>encodingFilter</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>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<session-config>
<session-timeout>20</session-timeout>
</session-config>
<filter>
<filter-name>jcaptchaFilter</filter-name>
<filter-class>cn.gszhang.common.base.security.jcatpcha.JCaptchaFilter</filter-class>
<init-param>
<param-name>failureUrl</param-name>
<param-value>/security/login</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>jcaptchaFilter</filter-name>
<url-pattern>/security/jcaptcha.jpg</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>jcaptchaFilter</filter-name>
<url-pattern>/security/doLogin</url-pattern>
</filter-mapping>
<filter>
<filter-name>jcaptchaFilterRetrivPwd</filter-name>
<filter-class>cn.gszhang.common.base.security.jcatpcha.JCaptchaFilter</filter-class>
<init-param>
<param-name>failureUrl</param-name>
<param-value>/security/forgetpwd</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>jcaptchaFilterRetrivPwd</filter-name>
<url-pattern>/security/pwdIocn_11.jpg</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>jcaptchaFilterRetrivPwd</filter-name>
<url-pattern>/security/stepone</url-pattern>
</filter-mapping>

<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
<init-param>
<param-name>logLevel</param-name>
<param-value>WARN</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.jpg</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.png</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.gif</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.js</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.css</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>activeReverseAjaxEnabled</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>initApplicationScopeCreatorsAtStartup</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>maxWaitAfterWrite</param-name>
<param-value>1000</param-value>
</init-param>
<init-param>
<param-name>logLevel</param-name>
<param-value>warn</param-value>
</init-param>
<init-param>
<param-name>crossDomainSessionSecurity</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>org.directwebremoting.extend.Remoter</param-name>
<param-value>cn.gszhang.common.DWRSessionService</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>

 

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 2.6//EN"
"http://tuckey.org/res/dtds/urlrewrite2.6.dtd">
<urlrewrite>
<!-- 后台登录页/security/login -->
<rule>
<from>^/login.html$</from>
<to>/security/login</to>
</rule>
<!--首页 -->
<rule>
<from>^/index.html$</from>
<to>/portal/home/index.do</to>
</rule>
<rule>
<from>^/portal/home/index.html$</from>
<to>/portal/home/index.do</to>
</rule>
</urlrewrite>

 

spring-servlet.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">

<import resource="classpath*:applicationContext-dao.xml"/>
<import resource="classpath*:applicationContext-memcached.xml"/>
<import resource="classpath*:applicationContext-jms.xml"/>

<mvc:default-servlet-handler/>

<!--JCaptcha验证码服务 -->
<bean id="captchaService" class="com.octo.captcha.service.image.DefaultManageableImageCaptchaService">
<property name="captchaEngine">
<bean class="cn.gszhang.common.base.security.jcatpcha.CaptchaEngine"/>
</property>
</bean>


<!--Jackson-->
<mvc:annotation-driven>
<mvc:message-converters register-defaults="false">
<bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"/>
</mvc:message-converters>
</mvc:annotation-driven>

<!--登录拦截器-->
<mvc:interceptors>
<mvc:interceptor>
<!-- 需拦截的地址 -->
<!-- 一级目录 -->
<mvc:mapping path="/home/*" />
<!-- 需排除拦截的地址 -->
<mvc:exclude-mapping path="/security/login,/security/doLogin"/>
<bean class="cn.gszhang.common.base.interceptor.LoginInterceptor" />
</mvc:interceptor>
</mvc:interceptors>


<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>


</beans>

mybatis-resources.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<settings>
<!-- 全局启用或禁用缓存 -->
<setting name="cacheEnabled" value="false"/>
<!-- 全局禁用延迟加载 -->
<setting name="lazyLoadingEnabled" value="false"/>
<!-- 配合延迟加载使用 -->
<setting name="aggressiveLazyLoading" value="true"/>
<!-- 执行器重用语句和批量更新 -->
<setting name="defaultExecutorType" value="BATCH"/>
</settings>

<typeAliases>
<typeAlias type="cn.gszhang.project.system.domain.SysUser" alias="SysUser"/>
<typeAlias type="cn.gszhang.project.system.domain.SysRole" alias="SysRole"/>
<typeAlias type="cn.gszhang.project.system.domain.Menu" alias="Menu"/>
<typeAlias type="cn.gszhang.project.system.domain.Resource" alias="Resource"/>
<typeAlias type="cn.gszhang.common.base.support.PageBean" alias="PageBean"/>
</typeAliases>
</configuration>

 

 

 

#MySQL
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.host=127.0.0.1
jdbc.databaseName=gszhang
jdbc.url=jdbc:mysql://${jdbc.host}:3306/${jdbc.databaseName}?useUnicode=true&amp;characterEncoding=utf8
#### 数据库的用户名
jdbc.username=root
#### 数据库 密码
jdbc.password=123456

#### 连接池中保留的最小连接数
minPoolSize=5
#### 连接池中保留的最大连接数。Default: 15
maxPoolSize=30
#### 初始化时获取的连接数,取值应在minPoolSize与maxPoolSize之间。Default: 3
initialPoolSize=10
#### 最大空闲时间,60秒内未使用则连接被丢弃。若为0则永不丢弃。Default: 0
maxIdleTime=60
#### 当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。Default: 3
acquireIncrement=5
#### JDBC的标准参数,用以控制数据源内加载的PreparedStatements数量。但由于预缓存的 statements属于单个connection而不是整个连接池。
#### 所以设置这个参数需要考虑到多方面 的因素。如果maxStatements与maxStatementsPerConnection均为0,则缓存被关闭。Default: 0
maxStatements=0
#### 每60秒检查所有连接池中的空闲连接。Default: 0
idleConnectionTestPeriod=60
#### 定义在从数据库获取新连接失败后重复尝试的次数。Default: 30
acquireRetryAttempts=30
#### 获取连接失败将会引起所有等待连接池来获取连接的线程抛出异常。但是数据源仍有效保留,并在下次调用getConnection()的时候继续尝试获取连接。如果设为true,
#### 保留,并在下次调用getConnection()的时候继续尝试获取连接。如果设为true,那么在尝试获取连接失败后该数据源将申明已断开并永久关闭。Default: false
breakAfterAcquireFailure=true

#### 因性能消耗大请只在需要的时候使用它。如果设为true那么在每个connection提交的 时候都将校验其有效性。建议使用idleConnectionTestPeriod或automaticTestTable
#### 等方法来提升连接测试的性能。Default: false
testConnectionOnCheckout=false

 

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"
default-lazy-init="true">

<!--XMemcached客户端定义-->
<bean id="memcachedClient" class="cn.gszhang.common.base.memcached.MemcachedClient">
<property name="memcachedNodes" value="${memcached.url}"/>
<property name="connectionPoolSize" value="${memcached.connectionPoolSize}"/>
</bean>
</beans>

 

 

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<!-- ActiveMQ 连接工厂 -->
<bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL"
value="${jms.broker_url}"/>
<property name="userName" value="${jms.userName}"/>
<property name="password" value="${jms.password}"/>
</bean>

<!-- Spring Caching 连接工厂 -->
<bean id="cachingConnectionFactory"
class="org.springframework.jms.connection.CachingConnectionFactory">
<property name="targetConnectionFactory" ref="connectionFactory"/>
<property name="sessionCacheSize" value="${jms.sessionCacheSize}"/>
</bean>

<!-- Spring JMS Template -->
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="cachingConnectionFactory"/>
<property name="receiveTimeout" value="10000"/>
</bean>

<bean id="autoruleQueue" class="org.apache.activemq.command.ActiveMQQueue">
<constructor-arg value="q.autoruleQueue"/>
</bean>
<bean id="sendAutoRuleCmdProducer" class="cn.gszhang.common.base.jms.producor.NotifyMessageProducer">
<property name="destinationQueue" ref="autoruleQueue"/>
<property name="jmsTemplate" ref="jmsTemplate"/>
</bean>

<!-- 单点登录的生产者和消费者 -->
<!-- 生产者 -->
<bean id="singleLoginTopic" class="org.apache.activemq.command.ActiveMQTopic">
<constructor-arg value="t.ssPortalSingleLogin"/>
</bean>
<bean id="singleLoginTopicProducer" class="cn.gszhang.common.base.jms.producor.NotifyMessageProducer" autowire="byName">
<property name="destinationQueue" ref="singleLoginTopic"/>
<property name="jmsTemplate" ref="jmsTemplate"/>
</bean>
<!-- 消费者 -->
<bean id="singleLoginListener" class="cn.gszhang.common.base.jms.JMSSingleLoginListener" scope="singleton">
</bean>
<bean id="SingleLoginQueueContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="connectionFactory"/>
<property name="destination" ref="singleLoginTopic"/>
<property name="messageListener" ref="singleLoginListener"/>
<property name="concurrentConsumers" value="1"/>
</bean>
<!-- 单点登录的生产者和消费者 end-->



</beans>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

<!--<bean class="com.huawei.m2m.base.config.M2MPropertyDecryptPropertyConfigure">-->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="systemPropertiesModeName"
value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/>
<property name="ignoreResourceNotFound" value="true"/>
<property name="ignoreUnresolvablePlaceholders" value="true"/>
<property name="order" value="1"/>
<property name="locations">
<list>
<!--数据库配置-->
<value>classpath*:db.properties</value>
</list>
</property>
</bean>

<context:component-scan base-package="cn.gszhang"/>


<!-- 使用annotation 自动注册bean,并检查@Required,@Autowired的属性已被注入 -->
<!-- <context:component-scan base-package="cn.gszhang.project.orm.mybatis"/> -->

<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass">
<value>${jdbc.driverClassName}</value>
</property>
<property name="jdbcUrl">
<value>${jdbc.url}</value>
</property>
<property name="user">
<value>${jdbc.username}</value>
</property>
<property name="password">
<value>${jdbc.password}</value>
</property>
<property name="minPoolSize">
<value>${minPoolSize}</value>
</property>
<property name="maxPoolSize">
<value>${maxPoolSize}</value>
</property>
<property name="initialPoolSize">
<value>${initialPoolSize}</value>
</property>
<property name="maxIdleTime">
<value>${maxIdleTime}</value>
</property>
<property name="acquireIncrement">
<value>${acquireIncrement}</value>
</property>
<property name="maxStatements">
<value>${maxStatements}</value>
</property>
<property name="idleConnectionTestPeriod">
<value>${idleConnectionTestPeriod}</value>
</property>
<property name="acquireRetryAttempts">
<value>${acquireRetryAttempts}</value>
</property>
<property name="breakAfterAcquireFailure">
<value>${breakAfterAcquireFailure}</value>
</property>
<property name="testConnectionOnCheckout">
<value>${testConnectionOnCheckout}</value>
</property>
</bean>

 


<!-- mybitas 配置 sqlSessionFactory -->
<bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" value="classpath:mybatis-resources.xml"></property>
<property name="mapperLocations">
<list>
<value>classpath:cn/gszhang/project/*/mapper/**Mapper.xml</value>
</list>
</property>
</bean>

<!--jdbcTemplate define -->
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<constructor-arg ref="dataSource"/>
</bean>

<!-- 事务定义 start -->
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>

<!--默认事务声明-->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="save*" propagation="NESTED"/>
<tx:method name="update*" propagation="NESTED"/>
<tx:method name="del*" propagation="NESTED"/>
<tx:method name="create*" propagation="NESTED"/>
<tx:method name="*" propagation="REQUIRED" read-only="true"/>
</tx:attributes>
</tx:advice>
<!-- 事务定义 end -->


<!-- 告诉事务管理器 那些包以及那些类下需要Spring 去管理事务(一定是在SERVICE层上处理事务) -->
<aop:config>
<aop:pointcut expression="execution(* cn.gszhang.project.*.service.*.*(..))" id="perform"/>
<aop:advisor pointcut-ref="perform" advice-ref="txAdvice"/>
</aop:config>

 

<!-- 加载数据库配置文件 -->
<bean class="cn.gszhang.common.base.holder.SysparamPropertiesHolder">
<property name="systemPropertiesModeName"
value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/>
<property name="ignoreResourceNotFound" value="true"/>
<property name="ignoreUnresolvablePlaceholders" value="true"/>
<property name="order" value="2"/>
</bean>

</beans>

 

aaaa

标签:

原文地址:http://www.cnblogs.com/zhanggaosong/p/5801031.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!