网络编程中的spring-servlet.xml文件
来源:互联网 发布:令狐冲打少林寺知乎 编辑:程序博客网 时间:2024/05/29 17:24
同上一篇一样,也是私人配置。
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd"> <!-- the application context definition for the springapp DispatcherServlet --> <context:component-scan base-package="com.myweb"></context:component-scan> <mvc:annotation-driven/> <mvc:resources mapping="/css/**" location="/bootstrap/css/"/> <mvc:resources mapping="/js/**" location="/bootstrap/js/"/> <mvc:resources mapping="/images/**" location="/images/"/> <mvc:default-servlet-handler /> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/jsp/"></property> <property name="suffix" value=".jsp"></property> </bean> <!-- <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"><property name="mappings"><props><prop key="/index">IndexAction</prop> key是url后面的地址 </props></property> </bean> <bean id="IndexAction" class="com.myweb.IndexAction"> <property name="view"> <value>index</value> 对应到相应的jsp界面 </property> </bean> --> <bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://localhost:3306/myweb" /> <property name="username" value="root" /> <property name="password" value="root" /> </bean> <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"><property name="driverClassName" value="com.mysql.jdbc.Driver" /><property name="url" value="jdbc:mysql://localhost:3306/myweb?useUnicode=true&characterEncoding=utf-8" /><property name="username" value="root" /><property name="password" value="root" /><property name="filters" value="stat" /><!--最大连接数量 --><property name="maxActive" value="20" /> <!--初始连接数 --><property name="initialSize" value="5" /> </bean> <bean id="jb" class="org.springframework.jdbc.core.JdbcTemplate"> <property name="dataSource" ref="dataSource" /> </bean> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource"/> <property name="mapperLocations" value="classpath:com/myweb/database/mapper/*.xml" /> <property name="typeAliasesPackage" value="com.myweb.database.model" /> </bean><bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"><property name="basePackage" value="com.myweb.database.mapper"/><property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/></bean> </beans>
0 0
- 网络编程中的spring-servlet.xml文件
- Servlet在web.xml文件中的部署
- spring中的applicationContext.xml和xxx-servlet.xml
- springmvc中的spring-servlet.xml 和 applicationContext.xml
- java网络编程中的web.xml配置文件
- spring-servlet.xml 问题
- spring - servlet-context.xml
- spring *-servlet.xml
- spring-servlet.xml配置
- spring-servlet.xml配置文件
- Spring MVC 配置文件dispatcher-servlet.xml 文件详解
- Spring MVC 配置文件dispatcher-servlet.xml 文件详解
- spring引用另一xml文件中的bean
- spring的单元测试中的xml文件加载
- spring引用另一xml文件中的bean
- servlet中的web.xml
- Servlet中的web.xml
- Servlet中的web.xml
- (一〇一)第七章编程练习(附①至⑦章学习笔记下载链接)
- java面试题
- iOS---打印
- 第一篇从今天的ArrayAdapter开始
- RMAN实战16:ORACLE数据库的不完全恢复和闪回
- 网络编程中的spring-servlet.xml文件
- Android开发之多线程编程Thread和Runnable使用
- 如何成为数据分析师
- Java基础十大方向
- hive udaf开发入门和运行过程详解
- SQL Server DBA面试知识点(三)--SQL Server如何实现高可用性
- 计算机组成原理课程设计-基本模型机的设计与实现
- Theano-Deep Learning Tutorials 笔记:Getting Started
- 在64位ubuntu上安装tensorflow