码迷,mamicode.com
首页 > 编程语言 > 详细

springmvc.xml配置

时间:2019-04-30 23:56:43      阅读:239      评论:0      收藏:0      [点我收藏+]

标签:静态   component   adsi   tip   zook   conf   pac   mapping   control   

<?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>

 

springmvc.xml配置

标签:静态   component   adsi   tip   zook   conf   pac   mapping   control   

原文地址:https://www.cnblogs.com/houchen/p/10798291.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!