You are on page 1of 1

http server

------------1) create webapplication


2) create interface and implementation classes
3) configure DispatcherServlet in web.xml
<servlet>
<servlet-name>remoting</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servle
t-class>
</servlet>
<servlet-mapping>
<servlet-name>remoting</servlet-name>
<url-pattern>/http/*</url-pattern>
</servlet>
4) create application context configuration file(.xml)
<servlet-name>-servlet.xml
ex: remoting-servlet.xml
5) configure HttpInvokerServiceExporter to export current object
<bean id="/servicename" class="org.springframework.remoting.httpinvoker.Ht
tpInvokerServiceExporter" >
<property name="service">
<ref bean="obj" />
</property>
<property name="serviceInterface" >
<value>interfacename</value>
</property>
</bean>
httpclient
--------------configure HttpInvokerProxyFactoryBean to receive remote object
1)
<bean id="s" class="org.springframework.remoting.httpinvoker.HttpInvokerPr
oxyFactoryBean" >
<property name="serviceUrl">
<value>http://sm:8080/httpserver/http/servicename</value>
</property>
<property name="serviceInterface" >
<value>interfacename</value>
</property>
</bean>

You might also like