spring-hessian简单示例
需要包:
spring 2.5.6
hessian 3.1.6
spring2.5.6不支持hessian4.0
web容器:
tomcat 6.0
1、定义接口;
public TBean implements Serializable{ private String name; private String code; /** *todo: get and set method here */}public interface IHello{ TBean hello(TBean tb);}public class Hello implements IHello{ /**todo:*/}<bean id="hello" name="code"> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:conf/spring/spring*.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>remote</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:conf/spring/spring.remote.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>remote</servlet-name> <url-pattern>/remote/*</url-pattern> </servlet-mapping>