spring.xml
来源:互联网 发布:神知第二季720百度云 编辑:程序博客网 时间:2024/06/07 00:17
<?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:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
">
<context:component-scan base-package="cn"></context:component-scan>
<bean id="factoryBean" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
<property name="validationMessageSource" ref="messageSource"></property>
</bean>
<!-- 视图解析器 -->
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix="/lesson03/" p:suffix=".jsp">
</bean>
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver"></bean>
<!-- 中英文转换 -->
<mvc:interceptors>
<bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" p:paramName="request_locale"></bean>
</mvc:interceptors>
<!--
文件上传解析器
-->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="maxUploadSize" value="1048576"></property>
</bean>
<mvc:annotation-driven validator="factoryBean">
</mvc:annotation-driven>
<context:property-placeholder location="classpath:/jdbc.properties"/>
<!-- 数据库连接 也叫数据源 -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="url" value="${url}"></property>
<property name="driverClassName" value="${driverClass}"></property>
<property name="username" value="${userNm}"></property>
<property name="password" value="${passWord}"></property>
</bean>
<bean id="JdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource"></property>
</bean>
</beans>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
">
<context:component-scan base-package="cn"></context:component-scan>
<bean id="factoryBean" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
<property name="validationMessageSource" ref="messageSource"></property>
</bean>
<!-- 视图解析器 -->
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix="/lesson03/" p:suffix=".jsp">
</bean>
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver"></bean>
<!-- 中英文转换 -->
<mvc:interceptors>
<bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" p:paramName="request_locale"></bean>
</mvc:interceptors>
<!--
文件上传解析器
-->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="maxUploadSize" value="1048576"></property>
</bean>
<mvc:annotation-driven validator="factoryBean">
</mvc:annotation-driven>
<context:property-placeholder location="classpath:/jdbc.properties"/>
<!-- 数据库连接 也叫数据源 -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="url" value="${url}"></property>
<property name="driverClassName" value="${driverClass}"></property>
<property name="username" value="${userNm}"></property>
<property name="password" value="${passWord}"></property>
</bean>
<bean id="JdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource"></property>
</bean>
</beans>
阅读全文
0 0
- Spring.xml
- spring.xml
- spring.xml
- spring xml
- spring xml
- spring-xml
- spring.xml
- Spring.xml
- spring.xml
- spring mybatis(spring-mybatis.xml)
- spring配置文件-spring-config.xml
- 配置pom.xml、spring.xml、spring-mvc.xml、spring-mybatis.xml、web.xml
- Spring XML配置技巧
- Spring XML配置技巧
- web.xml[spring][encoding]
- Spring bean.xml location
- spring的XML配置文件
- about spring applicationContext.xml
- 汇编语言: 设有 10 个学生的成绩分别是 76,69,84,90,73,88,99,63,100 和 80 分。试编 制一个子程序统计 60-69 分,70-79 分,80-89 分,90-99 分
- Canvas-开始玩svg
- 牛腩系统-分页
- <c:forEach>详解
- 汇编语言: 编写子程序嵌套结构的程序,把整数分别用二进制和八进制形式显示出来。
- spring.xml
- Maven项目的目录结构
- JAVA编程基础之内部类的简单使用
- python中的csv模块
- 汇编语言: 主程序 BANDO:把整数字变量 VAL1 存入堆栈,并调用子程序 PAIRS;子程序 PAIRS:从 堆栈中取出 VAL1,调用二进制显示程序 OUTBIN 显示出与其等效的二进制数,输
- HDU 2003 求绝对值 C语言课本习题 基础题
- repo sync同步出错问题
- leetcode 462. Minimum Moves to Equal Array Elements II
- 31_面向对象_04_程序执行过程的内存分析_01