<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
?>
<
beans
xmlns
=
"http://www.springframework.org/schema/beans"
xmlns:xsi
=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop
=
"http://www.springframework.org/schema/aop"
xmlns:context
=
"http://www.springframework.org/schema/context"
xmlns:mvc
=
"http://www.springframework.org/schema/mvc"
xmlns:jee
=
"http://www.springframework.org/schema/jee"
xmlns:lang
=
"http://www.springframework.org/schema/lang"
xmlns:p
=
"http://www.springframework.org/schema/p"
xmlns:tx
=
"http://www.springframework.org/schema/tx"
xmlns:util
=
"http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<
context:component-scan
base-package
=
"org.lee"
/>
<
mvc:annotation-driven
/>
<
aop:aspectj-autoproxy
/>
<
bean
class
=
"org.springframework.web.servlet.view.InternalResourceViewResolver"
>
<
property
name
=
"prefix"
value
=
"/WEB-INF/view/"
/>
<
property
name
=
"suffix"
value
=
".jsp"
/>
</
bean
>
<
bean
id
=
"messageSource"
class
=
"org.springframework.context.support.ResourceBundleMessageSource"
>
<
property
name
=
"basenames"
value
=
"i18n.message"
></
property
>
<
property
name
=
"defaultEncoding"
value
=
"UTF-8"
/>
</
bean
>
<
bean
id
=
"localeResolver"
class
=
"org.springframework.web.servlet.i18n.SessionLocaleResolver"
></
bean
>
<
bean
id
=
"localeChangeInterceptor"
class
=
"org.springframework.web.servlet.i18n.LocaleChangeInterceptor"
>
<
property
name
=
"paramName"
value
=
"locale"
/>
</
bean
>
<
mvc:resources
location
=
"/My97DatePicker/"
mapping
=
"/My97DatePicker/**"
/>
<
mvc:resources
location
=
"/static/lib/"
mapping
=
"/static/lib/**"
/>
<
mvc:resources
location
=
"/static/css/"
mapping
=
"/static/css/**"
/>
<
mvc:resources
location
=
"/static/assets/"
mapping
=
"/static/assets/**"
/>
<
mvc:resources
location
=
"/static/js/"
mapping
=
"/static/js/**"
/>
<
mvc:resources
location
=
"/static/js/jqprint/"
mapping
=
"/static/js/jqprint/**"
/>
<
mvc:resources
location
=
"/static/bootstrap-3.3.5-dist/css/"
mapping
=
"/static/bootstrap-3.3.5-dist/css/**"
/>
<
mvc:resources
location
=
"/static/bootstrap-3.3.5-dist/js/"
mapping
=
"/static/bootstrap-3.3.5-dist/js/**"
/>
<
mvc:resources
location
=
"/static/bootstrap-3.3.5-dist/fonts/"
mapping
=
"/static/bootstrap-3.3.5-dist/fonts/**"
/>
<
mvc:resources
location
=
"/static/bootstrap-multiselect-0.9.13/dist/css/"
mapping
=
"/static/bootstrap-multiselect-0.9.13/dist/css/**"
/>
<
mvc:resources
location
=
"/static/bootstrap-multiselect-0.9.13/dist/js/"
mapping
=
"/static/bootstrap-multiselect-0.9.13/dist/js/**"
/>
<
mvc:resources
location
=
"/static/bootstrap-multiselect-0.9.13/dist/less/"
mapping
=
"/static/bootstrap-multiselect-0.9.13/dist/less/**"
/>
<
mvc:resources
location
=
"/static/bootstrap-multiselect-0.9.13/docs/css/"
mapping
=
"/static/bootstrap-multiselect-0.9.13/docs/css/**"
/>
<
mvc:resources
location
=
"/static/bootstrap-multiselect-0.9.13/docs/js/"
mapping
=
"/static/bootstrap-multiselect-0.9.13/docs/js/**"
/>
<
mvc:resources
location
=
"/static/bootstrap-multiselect-0.9.13/docs/less/"
mapping
=
"/static/bootstrap-multiselect-0.9.13/docs/less/**"
/>
<
bean
id
=
"validator"
class
=
"org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"
>
<
property
name
=
"providerClass"
value
=
"org.hibernate.validator.HibernateValidator"
/>
<
property
name
=
"validationMessageSource"
ref
=
"messageSource"
/>
</
bean
>
<
mvc:annotation-driven
validator
=
"validator"
/>
<
bean
id
=
"dataSource"
class
=
"com.alibaba.druid.pool.DruidDataSource"
init-method
=
"init"
destroy-method
=
"close"
>
<
property
name
=
"url"
value
=
"jdbc:mysql://localhost:3306/apj?useUnicode=true&characterEncoding=utf-8"
/>
<
property
name
=
"username"
value
=
"root"
/>
<
property
name
=
"password"
value
=
"123456"
/>
</
bean
>
<
bean
id
=
"jdbcTemplate"
class
=
"org.springframework.jdbc.core.JdbcTemplate"
abstract
=
"false"
lazy-init
=
"false"
autowire
=
"default"
>
<
property
name
=
"dataSource"
>
<
ref
bean
=
"dataSource"
/>
</
property
>
</
bean
>
<
bean
id
=
"sessionFactory"
class
=
"org.springframework.orm.hibernate4.LocalSessionFactoryBean"
>
<
property
name
=
"dataSource"
ref
=
"dataSource"
/>
<
property
name
=
"packagesToScan"
value
=
"org.lee.model"
></
property
>
<
property
name
=
"hibernateProperties"
>
<
props
>
<
prop
key
=
"dialect"
>org.hibernate.dialect.MySQL5Dialect</
prop
>
<
prop
key
=
"show_sql"
>true</
prop
>
<
prop
key
=
"hbm2ddl.auto"
>update</
prop
>
</
props
>
</
property
>
</
bean
>
<
bean
id
=
"transactionManager"
class
=
"org.springframework.orm.hibernate4.HibernateTransactionManager"
>
<
property
name
=
"sessionFactory"
ref
=
"sessionFactory"
/>
</
bean
>
<
tx:annotation-driven
transaction-manager
=
"transactionManager"
/>
<
bean
class
=
"org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"
>
<
property
name
=
"messageConverters"
>
<
list
>
<
ref
bean
=
"mappingJackson2HttpMessageConverter"
/>
</
list
>
</
property
>
</
bean
>
<
bean
id
=
"mappingJackson2HttpMessageConverter"
class
=
"org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"
>
<
property
name
=
"supportedMediaTypes"
>
<
list
>
<
value
>application/json;charset=UTF-8</
value
>
<
value
>text/html;charset=UTF-8</
value
>
<
value
>text/json;charset=UTF-8</
value
>
</
list
>
</
property
>
</
bean
>
<
bean
id
=
"multipartResolver"
class
=
"org.springframework.web.multipart.commons.CommonsMultipartResolver"
/>
<
mvc:interceptors
>
<
mvc:interceptor
>
<
mvc:mapping
path
=
"/**"
/>
<
mvc:exclude-mapping
path
=
"/login"
/>
<
mvc:exclude-mapping
path
=
"/logout"
/>
<
mvc:exclude-mapping
path
=
"/static"
/>
<
bean
class
=
"org.lee.Interceptor.LoginInterceptor"
></
bean
>
</
mvc:interceptor
>
</
mvc:interceptors
>
</
beans
>