Introduction to J2EE and JAX
I've been watching the evolution of Java technology since the very early JDK 1.0 releases. At that point, much of the excitement about Java had to do with the applet technology, and Java was seen as a serious threat to Microsoft for the desktop. Since then, many other "perfect matches" for Java technology have emerged; many have just as quickly left the scene. But while Java no longer seems likely to displace Microsoft, it has increasingly become the technology of choice for developing server-side applications. The recent emergence of Web-Service technologies has only served to put Java in even better shape on the server side, as a majority of IT managers have indicated they see Java 2 Enterprise Edition (J2EE) technologies as more ready to develop and deploy with than .NET.
Web Services will definitely play a major role in creating future applications; but I believe that role is still secondary to fundamental technologies such as Java servlets that can support both traditional, browser-oriented interfaces as well as newer, XML- and SOAP-based Web Services. For that reason, this book spends a lot of time exploring the foundation technologies that are vital to supporting Web Services, but that are themselves separate from the Web Service.
Web-Service technologies are still immature. Much of the software used to develop the example applications in this book was prerelease, early access, or otherwise not production quality. In many cases, the specifications themselves are still evolving, so the software will change to reflect the final specification. For this reason, anyone starting a Web-Service project today should be budgeting time for rework down the road. In the early chapters of this book, much emphasis is placed on layering software and making good use of object-oriented principles; this will help isolate those portions of your application that will need to be changed to reflect any updates to the underlying technologies.
1.1 Why This Book Was Written
This book came about not because of any burning desire to teach other people J2EE and Web Services, but rather because of a desire to learn more about these topics myself. To learn the new technologies, I did a lot of reading; but the most important activity was creating the sample programs. The same will be true for you; by reading through the text and examples presented herein, you'll be able to get a feel for the technologies that make up J2EE. My goal for each technology covered is to help you understand when it could be used, what the alternative technologies might be, and how to decide which technology is the best fit for the task you're faced with. This level of understanding can be achieved through reading. But once you've decided that a particular technology is something you will use, reading itself will not be sufficient; you'll need to roll up your sleeves and do some programming. I provide exercises in each chapter that can certainly help get you started, but it will be even more important to create your own programs that deal with the kinds of problems you need to solve.
My goals in writing this book are the following:
Introduce J2EE technologies, explaining each one well enough so that you can determine which ones deserve further study, and which ones aren't a good fit for the job you are trying to do.
Explain Web Services and show how J2EE technologies can be used to implement them. I believe that Web Services are rarely standalone, but are instead part of larger Web applications. So technologies that are commonly used in Web Services receive extra emphasis, but other Web-application technologies are covered as well, even if they are not directly involved in the delivery of Web Services.
Provide sample programs for each technology that can be used as a template for how to use the targeted technology.
Provide only the level of technical detail needed to grasp the capabilities and limitations of each technology. Don't try to examine every single feature or obscure usage. Apply the 80-20 rule.
Provide exercises that help cement an understanding of each technology.
Provide references for further study, both printed and online, for those readers who need to gain a more detailed understanding of specific technologies.
Have fun. Make the examples interesting, and try to avoid dry, boring text.