<?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.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.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- 配置controller扫描 -->
<context:component-scan base-package="com.taotao.manager.controller" />
<!-- 配置注解驱动 -->
<mvc:annotation-driven />
<!--加载env配置文件,文件上传的路径-->
<context:property-placeholder location="classpath:env.properties"/>
<!-- 配置视图解析器 ,配置前缀和后缀 -->
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/" />
<property name="suffix" value=".jsp" />
</bean>
<!--配置上传文件解析器-->
<!--必须配置id+"multipartResolver",否则解析器不能使用-->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!--文件大小检验-->
<property name="maxUploadSize" value="5000000"/>
</bean>
<!-- 配置dubbo服务 -->
<dubbo:application name="taotao_manager_web" />
<!-- 第一种使用广播 -->
<!-- <dubbo:registry address="multicast://224.5.6.7:1234" />-->
<!--第三种zookeeper-->
<dubbo:registry protocol="zookeeper" address="192.168.37.161:2181"/>
<!-- 声明要调用的服务,timeout是设置连接超时最长时间,如果不设置,超时时间默认是3秒 -->
<dubbo:reference interface="com.taotao.manager.interfaces.TestService"
id="testServiceImpl" timeout="1000000" /><!--第二种url="dubbo://127.0.0.1:20880"-->
<dubbo:reference interface="com.taotao.manager.interfaces.ItemCatService"
id="itemCatService" timeout="1000000" />
<dubbo:reference interface="com.taotao.manager.interfaces.ItemService"
id="itemService" timeout="1000000" />
<dubbo:reference interface="com.taotao.manager.interfaces.ItemDescService"
id="itemDescService" timeout="1000000" />
<dubbo:reference interface="com.taotao.manager.interfaces.ContentService"
id="contentService" timeout="1000000" />
<dubbo:reference interface="com.taotao.manager.interfaces.ContentCategoryService"
id="contentCategoryService" timeout="1000000" />
</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: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.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.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- 配置controller扫描 -->
<context:component-scan base-package="com.taotao.manager.controller" />
<!-- 配置注解驱动 -->
<mvc:annotation-driven />
<!--加载env配置文件,文件上传的路径-->
<context:property-placeholder location="classpath:env.properties"/>
<!-- 配置视图解析器 ,配置前缀和后缀 -->
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/" />
<property name="suffix" value=".jsp" />
</bean>
<!--配置上传文件解析器-->
<!--必须配置id+"multipartResolver",否则解析器不能使用-->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!--文件大小检验-->
<property name="maxUploadSize" value="5000000"/>
</bean>
<!-- 配置dubbo服务 -->
<dubbo:application name="taotao_manager_web" />
<!-- 第一种使用广播 -->
<!-- <dubbo:registry address="multicast://224.5.6.7:1234" />-->
<!--第三种zookeeper-->
<dubbo:registry protocol="zookeeper" address="192.168.37.161:2181"/>
<!-- 声明要调用的服务,timeout是设置连接超时最长时间,如果不设置,超时时间默认是3秒 -->
<dubbo:reference interface="com.taotao.manager.interfaces.TestService"
id="testServiceImpl" timeout="1000000" /><!--第二种url="dubbo://127.0.0.1:20880"-->
<dubbo:reference interface="com.taotao.manager.interfaces.ItemCatService"
id="itemCatService" timeout="1000000" />
<dubbo:reference interface="com.taotao.manager.interfaces.ItemService"
id="itemService" timeout="1000000" />
<dubbo:reference interface="com.taotao.manager.interfaces.ItemDescService"
id="itemDescService" timeout="1000000" />
<dubbo:reference interface="com.taotao.manager.interfaces.ContentService"
id="contentService" timeout="1000000" />
<dubbo:reference interface="com.taotao.manager.interfaces.ContentCategoryService"
id="contentCategoryService" timeout="1000000" />
</beans>