首先是服务端的配置:
1.配置web.xml
<servlet>
<servlet-name>remoting</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<param-name>namespace</param-name>
<param-value>config/remote</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>remoting</servlet-name>
<url-pattern>/remoting/*</url-pattern>
</servlet-mapping>
2.配置remote.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"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean name="/sjProjClassService" class="org.springframework.remoting.caucho.HessianServiceExporter">
<property name="service" ref="sjProjClassService"/>
<property name="serviceInterface" value="heb.pamf.zj.service.ISJProjClassServer"/>
</bean>
</beans>
*每一个接口都要配置一个bean
3.springMvc中service配置
4.需要引入hessian的jar'包
5.编写接口并实现
*接口中用到的javabean一定要序列化,命名空间要一致