|
JavaTM Servlet technology has done much towards making Web application development an easier task. With a platform- and server-independent approach based on the JavaTM language, servlets provide developers with an easier way to build high-performance, dynamic Web pages compared to traditional CGI programs. With JavaServer PagesTM (JSPTM) technology, Sun makes creating dynamic HTML and XML Web pages even simpler. JSP technology is a major extension of Java Servlet technology that makes building and maintaining dynamic pages much easier, and supports the distributed development model common in larger enterprises. JSP technology opens up dynamic pages to a wide range of page authors, while offering all of the benefits of the Java platform. This paper describes how JSP technology extends the basic servlet framework to support easier and faster page authoring and maintenance. For those familiar with or already using servlets, incorporating the additional functionality of JSP technology is fast and easy. To find out more about how JSP pages fit with what you already do, please see the JavaServer Pages Technology for Servlet Developers paper.
As the server-side counterpart of an applet, Java servlets have made many Web applications possible. With Java servlets, Web developers get a simple, consistent mechanism for extending the functionality of a Web server and accessing existing business systems. Today, servlets are a popular choice for building interactive Web applications. Third-party servlet containers are available for the Apache Web server, iPlanetTM Web Server (formerly NetscapeTM Enterprise Server), Microsoft IIS, and others. Servlet containers can also be integrated with Web-enabled application servers such as the BEA WebLogic application server, IBM WebSphere, Netscape Application Server, and more. A major advantage is of servlets is that they provide a component-based, platform-independent method for building Web-based applications - without the performance limitations of CGI programs. And unlike proprietary server extension mechanisms (such as the Netscape Server API or Apache modules), servlets are both server and platform independent. This enables companies to select a best-of-breed strategy for their servers, platforms, and tools. Written in the Java language, servlets have access to the entire family of Java APIs, including the JDBCTM API, to access enterprise databases. Servlets can also access a library of HTTP-specific calls, and offer all the benefits of the mature Java language, including portability, performance, reusability, and crash protection. But for all of their benefits, servlets are still primarily a developer's tool. With JSP technology, the capabilities of servlets have been extended to a broader audience of page authors.
A JSP page is actually compiled into a servlet when it is called, so JSP technology is truly an extension of servlet technology. However, JSP pages make servlets much easier to write and maintain by changing the approach to creating servlets. A page created with JSP technology can be thought of as an "inside-out" servlet. In a servlet, fixed page elements (such as text) are embedded in the application logic (for example, in an out.println statement). Between the statements and the other programming overhead (such as preambles and boilerplates), it can be difficult to even find the fixed elements, much less change them. In contrast, a JSP page embeds the application logic within standard HTML (or XML) templates. Page authors can create or edit page design elements or text without affecting application logic at all. Because the JSP format automatically takes care of the programming overhead, and the JSP container automatically compiles the page when it is called, the process of creating and revising pages is greatly simplified versus that of writing and compiling servlet programs. The application logic, which is embedded in the JSP page, may be in one of the following forms:
JSP technology simplifies and speeds the development process for developers and page authors alike by separating code development and page layout activities.
JSP pages are not only fast to deploy, they are easy to maintain over time. This is due to the separation of application logic (typically residing within customized tag libraries or beans) from page design/content. For example:
Using JSP technology, individuals responsible for pages can make content changes without requiring a developer's time. This leads to faster application changes and overall easier application maintenance.
There are many ways to use JSP pages within a broader Web-based application. As part of the Java family, JSP technology has access to all of the Java APIs and components. For example, a JSP page may include a request of a servlet to process information. The JSP page could determine details of the request, and then forward the request appropriately based on the request properties. A JSP page may access other data sources directly, using the appropriate Java invocation method. JSP pages and servlets can access relational databases through the JDBC API. In the future, custom tags will handle the database management functions. The architecture diagrammed below is a simple method for accessing data sources, and suits relatively low-volume applications.
JSP pages may call other Java components, such as Enterprise JavaBeansTM (EJB) components. For example, an EJB component and container can manage access to external resources, providing better performance for high-volume applications. By implementing custom JSP tags to support calls to these resources, the page author can be shielded from the details of the enterprise environment.
A Java Solution for the Enterprise JSP and Java Servlet technologies offer all the advantages of the Java language, a mature, simplified solution suitable for both large and small applications. It offers:
JSP and Java Servlet technologies are part of the Java 2 Platform, Enterprise Edition (J2EE), and provide a highly flexible and scalable solution for building multitier applications in the enterprise environment because they:
In conclusion, using JSP and Java Servlet technologies helps leverage all the benefits of Java technology for rapid application deployment and easier application maintenance. Servlets and JSP pages can support large-scale interactive Web applications in the enterprise environment with a distributed development model. Web developers can create cross-platform application components as JavaBeans, Enterprise JavaBeans, or customized tag libraries. And page authors can use a simplified interface to integrate this logic into their page designs. | |||||||||||||
Oracle is reviewing the Sun product roadmap and will provide guidance to customers in accordance with Oracle's standard product communication policies. Any resulting features and timing of release of such features as determined by Oracle's review of roadmaps, are at the sole discretion of Oracle. All product roadmap information, whether communicated by Sun Microsystems or by Oracle, does not represent a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. It is intended for information purposes only, and may not be incorporated into any contract.
|
| ||||||||||||