Project selected Hessian as the implementation of the Web service, is indeed very lightweight, and the speed of the same as directly with the socket, all is binary transmission save a lot of overhead. However, in the use of the business need is to obtain the remote IP address, host name and other information. Turn Hessian documents and Google the N times did not, forced to Caucho and spring forum to ask, have not been answered. Today's heart a horizontal Hessian source code added to the project single step tracking, finally a little harvest. Shortcoming share out, on the one hand to the needs of friends, mainly hope you find out whether there are bugs, and whether there are better improvements.
One: Leave spring aside, to see the call of pure Hessian
According to the Hessian document introduced in the demo, in the Web.xml inside the following configuration
Java code
<servlet>
<servlet-name>hello</servlet-name>
<servlet-class>com.caucho.hessian.server.HessianServlet</servlet-class>
<init-param>
<param-name>home-class</param-name>
<param-value>example.BasicService</param-value>
</init-param>
<init-param>
<param-name>home-api</param-name>
<param-value>example.Basic</param-value>
</init-param>
</servlet>
<servlet-mapping>
<url-pattern>/hello</url-pattern>
<servlet-name>hello</servlet-name>
</servlet-mapping>
So the entrance to the Hessian call is Hessianservlet this servlet, go inside and see