Spring集成Hessian
来源:互联网 发布:知乎 爬虫 加载 编辑:程序博客网 时间:2024/06/05 09:46
服务端
第一步:导入相关包,包括hessian3.1.5.jar和spring-web-3.1.2.RELEASE.jar等。
第二步:写一个普通的接口,例如以下:
第三步,实现HelloService的接口,如下所示:
第四步,建立对HelloService接口的暴露,假设文件为src/spring/spring-hessian.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" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:lang="http://www.springframework.org/schema/lang" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"> <!-- Name保持与web.xml中的一致,web.xml下文中描述 --> <bean name="HelloServiceExporter" class="org.springframework.remoting.caucho.HessianServiceExporter"> <!-- service的ref与HelloServiceImpl中@Service中配置的一致 --> <property name="service" ref="com.gsoft.geloin.service.HelloService" /> <!-- 接口的路径 --> <property name="serviceInterface" value="com.gsoft.geloin.service.HelloService" /> </bean> </beans>
第五步,配置web.xml,关键配置如下所示:
第六步,启动你的项目,假设项目访问地址为http://localhost:8080/hello。
客户端
第一步,将服务端中的HelloService打成jar包,放到客户端中,仅接口即可(或可包含相关的bean,以接口中用到的bean为准)。
第二步,代码如下所示:
0 0
- Spring集成Hessian
- Spring集成Hessian
- spring hessian 集成开发
- Spring 集成 Hessian
- spring 集成 Hessian
- spring集成Hessian
- Hessian与Spring集成
- Spring集成Hessian
- hessian入门,spring集成
- Hessian入门(与Spring集成)
- Hessian入门(与Spring集成)
- Hessian入门(与Spring集成)
- Hessian入门(与Spring集成)
- Hessian入门(与Spring集成)
- 二、hessian与spring集成
- Hessian入门(与Spring集成)
- hessian集成spring注解实现
- Hessian集成Spring使用案例
- 邮箱验证正则表达式【转载】
- java正则表达式学习
- 多线程问题的总结
- Linux自学笔记(四)注意事项
- 动态规划和贪心算法之背包问题理解
- Spring集成Hessian
- 枚举(又称穷举)
- 九度OJ 1139 最大子矩阵
- NY562 & CSU1104 盒子游戏【博弈】
- Linux从程序到进程
- Linux常见系统故障排除
- hdu 5854K-th value (2016多校第九场1011) 树形dp
- 整合CKEditor和CKFinder(for java)
- uva 147 Dollars