代碼如下
RomoteTest
package client;
import
import server
import com
public class RomoteTest {
public static void main(String[] args) {
String url = //localhost:
HessianProxyFactory factory = new HessianProxyFactory();
try {
Hello hello = (Hello) factory
System
} catch (MalformedURLException e) {
e
}
}
}
HelloImpl
package server
import server
public class HelloImpl implements Hello {
public String hello(String name) {
return
}
}
Hello
package server;
public interface Hello {
String hello(String name);
}
web
<?xml version=
<web
xmlns:xsi=
xsi:schemaLocation=
<servlet>
<servlet
<servlet
com
</servlet
<init
<param
<param
</init
<load
</servlet>
<servlet
<servlet
<url
</servlet
</web
所需jar包
From:http://tw.wingwit.com/Article/program/Java/hx/201311/26209.html