Hessian入门
来源:互联网 发布:推广营销软件 编辑:程序博客网 时间:2024/06/08 03:29
一:服务端(HessianServlet暴露服务)
web.xml<servlet><servlet-name>helloworld</servlet-name><servlet-class>com.caucho.hessian.server.HessianServlet</servlet-class><!-- 一个服务对应一个HessianServlet ? --><init-param><param-name>home-class</param-name><param-value>com.xx.service.impl.DefaultSayHelloServiceImpl</param-value></init-param><init-param><param-name>home-api</param-name><param-value>com.xx.service.ISayHelloService</param-value></init-param></servlet><servlet-mapping><servlet-name>helloworld</servlet-name><url-pattern>/helloworld.h</url-pattern></servlet-mapping>
package com.xx.service;public interface ISayHelloService {/** * @param name * @return */ String doSayHello(String name);}
package com.xx.service.impl;import com.xx.service.ISayHelloService;public class DefaultSayHelloServiceImpl implements ISayHelloService {public String doSayHello(String name) {return "hello, " + name;}}
二:客户端
String urlName = "http://localhost:8080/hessian_01/helloworld.h";HessianProxyFactory hessianProxyFactory = new HessianProxyFactory();ISayHelloService isHelloService = (ISayHelloService) hessianProxyFactory.create(ISayHelloService.class, urlName);System.out.println(isHelloService.doSayHello("李四 "));
- Hessian入门
- Hessian入门
- Hessian 入门
- Hessian入门
- hessian 入门
- Hessian入门
- hessian入门
- Hessian简单入门
- hessian 入门错误解决
- Hessian简单入门
- Hessian一个入门案例
- Hessian入门案例
- Hessian入门相关
- Hessian的入门
- —Hessian入门
- 1、Hessian入门
- Hessian简要入门
- hessian入门,spring集成
- 网购巨头京东赚钱揭秘,是自寻死路还是生财有道?
- page 12 MouseEvent
- ASP.NET中Get和Post的用法
- 记录一linux命令:xargs
- Smarty模板引擎中常见问题
- Hessian入门
- 关于JQueryMobile中Slider的一点研究 博客分类:
- Jeremey Lin(CD1683)
- FileDialog 使用方法(保存和载入)
- 最新版本的autohotkey不包含autoscript recorder
- page 13 KeyBoardEvent
- 徐中约先生的《中国近代史》书摘
- 手机存储卡知识及真假辨别 提防山寨卡
- gitweb