ChapterÂ 10.Â XML Deployment Descriptors
What Is an XML Deployment Descriptor?
One of the biggest changes between EJB 1.0 and 1.1 is the
deployment descriptors. In EJB 1.0, deployment descriptors were
serialized Java objects; you wrote a program that set up an
DeploymentDescriptor, and then
serialized that object. This approach was clumsy at best, even for
experienced developers. XML deployment descriptors are much easier to
edit, even without special tools for editing XML files. An XML
deployment descriptor is simple enough that itâs easy to create
a descriptor using nothing more than your favorite text editor, be it
Notepad, Emacs, or vi.
This chapter discusses what goes into an XML deployment descriptor; it teaches you how to write deployment descriptors for your beans. Keep in mind that you may never need to write a deployment descriptor by hand; most vendors of integrated development tools and EJB servers will provide tools for creating the descriptor automatically. Even if you have such a tool available, however, you should be familiar enough with deployment descriptors to be able to read them on your own.
This chapter doesnât attempt to teach you how to read or write
correct XML. There are many books on the subject; a good quick
reference is XML Pocket Reference by Bob
Eckstein (OâReilly). Very briefly, XML looks like HTML, but
with different tag names and different
attributes inside the tags. You
<p> inside a deployment ...