springmvc配置文件

xiaoxiao2025-08-14  28

<?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:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:mvc="http://www.springframework.org/schema/mvc" 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.1.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd"> <!--context--> <context:annotation-config></context:annotation-config> <context:component-scan base-package="com.kaige123.daomu"/> <!--mvc--> <mvc:annotation-driven></mvc:annotation-driven> <mvc:default-servlet-handler/> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="WEB-INF/Page/" p:suffix=".jsp"/> <mvc:resources mapping="**" location="WEB-INF/Page/"/> <bean id="initialize" class="com.kaige123.daomu.VIEW.Initialize"/> <!--DataSource--> <bean id="datasource" class="com.alibaba.druid.pool.DruidDataSource" p:driverClassName="com.mysql.jdbc.Driver" p:url="jdbc:mysql://localhost:3306/filedownloadcopy?characterEncoding=utf-8" p:username="root" p:password="" p:maxPoolPreparedStatementPerConnectionSize="100" ></bean> <!--myBatis--> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean" p:dataSource-ref="datasource" p:configLocation="classpath:configuration.xml" ></bean> <bean id="MapperIF" class="org.mybatis.spring.mapper.MapperScannerConfigurer" p:basePackage="com.kaige123.daomu.DAO.Mapper" p:sqlSessionFactoryBeanName="sqlSessionFactory" ></bean> <!--Spring Transaction Manager--> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="datasource"></property> </bean> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:RedisParameterConfig.properties</value> <value>classpath:path.properties</value> </list> </property> </bean> <bean class="com.kaige123.daomu.Server.PublicClass.UtilTool.JavaToRedis"> <constructor-arg name="ip" value="${RedisIp}"/> <constructor-arg name="port" value="${RedisPort}"/> <constructor-arg name="password" value="${RedisPassword}"/> </bean> <bean id="ip" class="com.kaige123.daomu.VIEW.util.IP"> <constructor-arg name="code" value="${aliIpCode}"/> <constructor-arg name="url" value="${RequestaliIpurl}"/> <constructor-arg name="path" value="${RequestaliIpPath}"/> </bean> <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" p:defaultEncoding="utf-8"></bean> <tx:annotation-driven transaction-manager="transactionManager"/> </beans>
转载请注明原文地址: https://www.6miu.com/read-5034822.html

最新回复(0)