Remoting
Remoting is one of the core features of EJB session beans. As a result, with declarative transactions, it's often used to justify the use of EJB, where it may not otherwise apply. In this lab, you'll learn how to do remoting declaratively—by writing configuration instead of any additional code—without EJB. In this example, you'll be able to use Spring's remoting service to access the business logic directly to get all of the bikes in the database over the internet.
Spring supports three kinds of HTTP services: Hessian, Burlap, and HTTP invokers. RMI is a favorite Java remoting technology, but you've got to open an additional port on your firewall, unless you're tunneling. The nice thing about HTTP protocols is that you're using the web's standard communication protocol, so you need not open up your system to do anything beyond what you've to do anyway to support the internet. For starters, you'll provide remote support to the façade through HTTP invokers.
How do I do that?
Most declarative remoting services
work by using proxies. For
this application, you'll configure remoting so that
other applications can access our façade.
You're going to need to prepare a client and a
server. To prepare the server, you need to set up a second servlet
for the remoting services. In the web.xml file,
add the servlet definition from Example 8-5.
Example 8-5. web.xml
<servlet> <servlet-name>remoting</servlet-name> <servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class> ...