Skip to Main Content
Spring: A Developer's Notebook
book

Spring: A Developer's Notebook

by Bruce Tate, Justin Gehtland
April 2005
Intermediate to advanced content levelIntermediate to advanced
216 pages
4h 44m
English
O'Reilly Media, Inc.
Content preview from Spring: A Developer's Notebook

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> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

JavaBeans Unleashed

JavaBeans Unleashed

Dr. Donald Doherty, Rick Leinecker
Beginning Spring

Beginning Spring

Mert Caliskan, Kenan Sevindik, Rod Johnson, Jürgen Höller
Hibernate Search in Action

Hibernate Search in Action

Emmanuel Bernard, John Griffin

Publisher Resources

ISBN: 0596009100Supplemental ContentErrata Page