Spring整合Hessian
http://s3.amazonaws.com/dist.springframework.org/release/SPR/spring-framework-2.5.6.SEC01-with-dependencies.zip
<beans>
<bean id="defaultHandlerMapping" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
<bean id="helloService" class="lavasoft.suths.service.HelloService"/>
<bean name="/hello" class="org.springframework.remoting.caucho.HessianServiceExporter">
<property name="service" ref="helloService"/>
<property name="serviceInterface" value="lavasoft.suths.service.Hello"/>
</bean>
</beans>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/hessian-servlet.xml
</param-value>
</context-param>
<servlet>
<servlet-name>hessian</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>4</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>hessian</servlet-name>
<url-pattern>/hessian/*</url-pattern>
</servlet-mapping>
</web-app>

import com.caucho.hessian.client.HessianProxyFactory;
import lavasoft.suths.service.Hello;
import java.net.MalformedURLException;
/**
* 客户端调用(会依赖服务接口)
*
* @author leizhimin 2009-8-14 12:29:33
*/
public class Client {
public static void main(String[] args) throws MalformedURLException {
String url = "http://localhost:8080/hessianapp/hessian/hello";
HessianProxyFactory factory = new HessianProxyFactory();
Hello hello = (Hello) factory.create(Hello.class, url);
System.out.println(hello.sayHello("Hessian"));
}
}
Process finished with exit code 0
<beans>
<bean id="helloServiceClient" class="org.springframework.remoting.caucho.HessianProxyFactoryBean">
<property name="serviceUrl" value="http://localhost:8080/hessianapp/hessian/hello"/>
<property name="serviceInterface" value="lavasoft.suths.service.Hello"/>
</bean>
</beans>
import lavasoft.suths.service.Hello;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
* Spring整合Hessian,客户端测试
*
* @author leizhimin 2009-8-14 15:32:46
*/
public class TestClient {
public static void main(String[] args) {
try {
ApplicationContext context = new ClassPathXmlApplicationContext("/remoting-client.xml");
Hello hello = (Hello) context.getBean("helloServiceClient");
System.out.println(hello.sayHello("Spring Hession"));
}
catch (Exception e) {
e.printStackTrace();
}
}
}
Process finished with exit code 0
spring-aop.jar
spring-beans.jar
spring-context.jar
spring-context-support.jar
spring-core.jar
spring-jdbc.jar
spring-jms.jar
spring-orm.jar
spring-test.jar
spring-tx.jar
spring-web.jar
spring-webmvc.jar
spring-webmvc-portlet.jar
spring-webmvc-struts.jar
hessian-3.1.3.jar
aopalliance.jar
commons-logging.jar
Spring整合Hessian的更多相关文章
- Spring整合Hessian访问远程服务
声明:该文章转载自Spring整合Hessian访问远程服务,本人搬过来只是为了记录下学习Hessian的过程,忘此博主理解,在此感谢,等本人有能力了再学一些原创的东东,本人实践了下,hessianS ...
- Spring整合Hessian的使用
该文章转赞自 https://www.cnblogs.com/ontheroad_lee/p/3797239.htm 个人感觉写的非常好,刚学习,先记录下来 1.1 Hessian简介 He ...
- hessian的简单使用以及与spring整合
Hessian是一个由Caucho Technology开发的轻量级二进制RPC协议.和其他Web服务的实现框架不同的是,Hessian是一个使用二进制格式传输的Web服务协议的框架,相对传统soap ...
- Hessian与Spring整合
1.服务端与Spring的整合 1.1:web.xml中配置控制器 <servlet> <servlet-name>hessian</servlet-name> & ...
- spring与hessian整合例
spring与hessian的简单应用实现例: 开发环境:window7 64,jdk8,tomcat8,spring4.2.5,hessian4.0 开发语言:java hessianServer端 ...
- 使用Spring整合Quartz轻松完成定时任务
一.背景 上次我们介绍了如何使用Spring Task进行完成定时任务的编写,这次我们使用Spring整合Quartz的方式来再一次实现定时任务的开发,以下奉上开发步骤及注意事项等. 二.开发环境及必 ...
- 【Java EE 学习 53】【Spring学习第五天】【Spring整合Hibernate】【Spring整合Hibernate、Struts2】【问题:整合hibernate之后事务不能回滚】
一.Spring整合Hibernate 1.如果一个DAO 类继承了HibernateDaoSupport,只需要在spring配置文件中注入SessionFactory就可以了:如果一个DAO类没有 ...
- spring整合hibernate的详细步骤
Spring整合hibernate需要整合些什么? 由IOC容器来生成hibernate的sessionFactory. 让hibernate使用spring的声明式事务 整合步骤: 加入hibern ...
- Spring整合Ehcache管理缓存
前言 Ehcache 是一个成熟的缓存框架,你可以直接使用它来管理你的缓存. Spring 提供了对缓存功能的抽象:即允许绑定不同的缓存解决方案(如Ehcache),但本身不直接提供缓存功能的实现.它 ...
随机推荐
- AOP和IOC个人理解
14:18 2014/5/5 IOC inversion of control 控制反转 将new对象的权力由调用者转移到spring容器(即xml文件),Struts2与Spring整合(scop ...
- 你所不知道的ref
在c#中有个关键字叫ref,它的作用是使参数按引用传递,基本用法如下: class RefExample { static void Method(ref int i) { i = ; } stati ...
- PDF、WORD、PPT、TXT转换方法
- The 9th Zhejiang Provincial Collegiate Programming Contest->Problem A:A - Taxi Fare
Problem A: Taxi Fare Time Limit: 2 Seconds Memory Limit: 65536 KB Last September, Hangzhou raised th ...
- Spark的TorrentBroadcast:概念和原理
依据Spark 1.4.1源码 SparkContext的broadcast方法 注释 可以用SparkContext将一个变量广播到所有的executor上,使得所有executor都能获取这个变量 ...
- Android支付接入(四):联通VAC计费
原地址:http://blog.csdn.net/simdanfeg/article/details/9012031 注意事项: 1.联通支付是不需要自己标识软硬计费点的,当平台申请计费点的时候会提交 ...
- 站长、运维必备| 网站可用性监控产品 OneAPM Cloud Test 上线
白天太忙,到了晚上才发现网站一天都没有访问量? 直到有用户投诉才发现网站完全无法访问? 还要每月付费才能及时了解网站可用情况? 监控频率太低,不能及时发现网站不可用? 第三方服务宕机,导致您的网站不可 ...
- SSH配置log4j的方法
SSH使用log4j的方便之处 1. 动态的改变记录级别和策略,即修改log4j.properties,不需要重启Web应用,这需要在web.xml中设置一下.2. 把log文件定在 /WEB-INF ...
- MySQL追加注释或者大量修改注释
MySQL追加注释或者大量修改注释 2016-01-25 20:28:05 分类: MySQL MySQL 5.6.14 之前一个项目比较仓促,开发给的建表语句没有注释.现在要补全注释信息.但是My ...
- 压力测试的轻量级具体做法 Apache ab
http://www.cnblogs.com/luminji/archive/2011/09/02/2163525.html