Buffalo 2.0 整合spring

Spring是当前最流行的轻量级容器,Buffalo对它进行了支持。Spring中任意一个配置过的bean, 都可以通过简单的配置被暴露为buffalo服务。 以下简单介绍下Buffalo2.0集成Spring的配置。

1. web.xml配置:

<display-name>

Buffalo Web Remoting Demostration Application

display-name>

<context-param>

<param-name>contextConfigLocationparam-name>

<param-value>/WEB-INF/applicationContext.xmlparam-value>

context-param>

<servlet>

<servlet-name>bfappservlet-name>

<servlet-class>

net.buffalo.web.servlet.ApplicationServlet

servlet-class>

servlet>

<servlet>

<servlet-name>contextservlet-name>

<servlet-class>

org.springframework.web.context.ContextLoaderServlet

servlet-class>

<load-on-startup>1load-on-startup>

servlet>

<servlet-mapping>

<servlet-name>bfappservlet-name>

<url-pattern>/bfapp/*url-pattern>

servlet-mapping>

2. SpringapplicationContext.xml配置:

<bean id=" yourService "

class="xxx.service.yourService ">bean>

<bean name="buffaloConfigBean"

class="net.buffalo.service.BuffaloServiceConfigurer">

<property name="services">

<map>

<entry key="yourService">

<ref bean=" yourService " />

entry>

你可能感兴趣的:(Buffalo 2.0 整合spring)