springmvc.xml配置

<?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:mvc="http://www.springframework.org/schema/mvc"
	xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" 
	xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd
        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd">

	<!-- 在spring中加载配置文件 -->
	<context:property-placeholder location="classpath:conf/resource.properties"/>
	
	<context:component-scan base-package="cn.e3mall.controller" />
	
	<!--利用注解驱动  配置springmvc的两大组件 -->
	<mvc:annotation-driven />
	
	<!-- 视图解析器 -->
	<bean
		class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<property name="prefix" value="/WEB-INF/jsp/" />
		<property name="suffix" value=".jsp" />
	</bean>
	
	<!-- 对静态资源进行放行 -->
	<mvc:resources location="/css/" mapping="/css/**"></mvc:resources>
	<mvc:resources location="/js/" mapping="/js/**"></mvc:resources>
	
	<!-- 定义文件上传解析器 -->
	<bean id="multipartResolver"
		class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
		<!-- 设定默认编码 -->
		<property name="defaultEncoding" value="UTF-8"></property>
		<!-- 设定文件上传的最大值5MB,5*1024*1024 -->
		<property name="maxUploadSize" value="5242880"></property>
	</bean>
	
	
	<!-- 引用dubbo服务 -->
	<dubbo:application name="e3-manager-web"/>
	<dubbo:registry protocol="zookeeper" address=" 192.168.25.129:2181"/>	
	<!-- itemService是 itemServiceImpl的一个代理对象-->
	<dubbo:reference interface="cn.e3mall.service.ItemService" id="itemService" />
	<dubbo:reference interface="cn.e3mall.service.ItemCatService" id="itemCatService" />
	
</beans>

猜你喜欢

转载自www.cnblogs.com/houchen/p/10798291.html