Plugs straight into the back of the Web server to process queries for dynamic services for which you need complex capabilities.
JSP
Used for simpler, dynamic Web−server capabilities wherein Java code is intermingled with the raw HTML and processed inline.
JavaMail
Interface to the mail and newsgroups capabilities. Used to interact with any form of mail system to either receive or send e−mail.
A common assumption made by programmers is that Servlets or JSPs are really only useful to someone dealing with Web browsers — that is, a person sitting in front of a machine looking at a Web page. They can be used for so much more than this. You can have two parts of the application talking together through an HTTP protocol passing binary data in each direction. This might be useful in situations in which you want to firewall off a certain piece of functionality behind other systems (for example, in an electronic−payment gateway system).
Cross−Reference
User presentation capabilities of the J2EE specification can be found in Part II,
"Delivering Content," where you'll find chapters on Servlet and JavaServer Pages technologies and JavaMail.
Data storage
As we have been hinting throughout this chapter, the data−storage APIs provide a level of abstraction beyond that of the individual protocols. Two main APIs are available here, both of which are documented in Table 1−2. Both of these APIs abstract you from the low−level connection details and provide an abstract representation of the data contained in the data source.
Table 1−2: APIs that provide abstracted data−storage capabilities 10
Chapter 1: Defining the Enterprise
API
Description
JDBC
Java DataBase Connectivity, an abstract representation of SQL interactions with a database. Enables you to create queries and to interact with the results in a Java−oriented manner rather than forcing you to use raw text processing.
JNDI
Java Naming and Directory Interface, an abstract representation of many different types of directory services, but most commonly used with LDAP databases. May also be used with DNS, file systems, and property systems (for example, Microsoft's Windows Registry).
To enable this abstraction between the data source and your code, both of these APIs use a service provider–implementation interface. This effectively enables a vendor to write an implementation without having to provide your code with the access to the vendor's internal code, while allowing the internals of the abstract API to get at the fundamental details. To configure a different provider, all you need is a string describing the name of the startup class. From there you can use and make queries on the underlying data source through the normal interfaces.
Cross−Reference
Data storage APIs are presented in Part III, "Finding Things with Databases and Searches," where we cover JDBC and JNDI. We also heavily cover the underlying technologies with separate chapters on SQL and LDAP.
Inter−system communications
J2EE only provides one set of inter−system communications based on XML. As XML is rapidly becoming the de facto standard for this type of work, we don't consider it much of an issue. Within the XML sphere, there is a lot of variety and many different groups all working to achieve some form of a standard — whether it be an industry standard, formal standard through one of the various bodies like ISO or W3C, or some other form. As there is no telling what will eventually become accepted, the J2EE specification is only adopting the most accepted of these proposed standards into the specification at this point. Although only four specifications are supported through J2EE, many others are working their way through the Java Community Process at the time of this writing. The standards that are covered by J2EE (and J2SE) are shown in Table 1−3.
Table 1−3: APIs that provide communications capabilities
API
Description
JAXP