Chapter 8. Writing Java Servlets

Servlets are ordinary Java programs that use additional packages (and the associated classes and methods) found in the Java Servlet API. Servlets generate dynamic content for web pages and run on the server.

The server can load a servlet automatically when it starts, or when the first client makes a request for the services of the servlet. Once loaded, servlets stay running, waiting for additional client requests.

Servlets extend the capabilities of the web server by creating a framework for providing requests and or response services over the web. A client sends a request to the server. The server sends the request information to the servlet. The servlet then constructs a response that the server sends back to the client. Servlets run independently of protocol or platform.

Java servlets can offer a performance advantage. Because they run on the server, they don’t require download time.This makes servlets faster than applications which run on the client’s system and require download time. When you choose to use a servlet, you don’t encounter difficulties with the application passing through a firewall. Java servlets also offer an additional performance advantage because they are multi-threaded.

Because it is a Java program, the servlet can use all the capabilities of the Java language in constructing the response. The servlet can also interact with outside resources, such as files, databases or other applications (also written in Java, or other languages), to construct the response.

The response to the client, therefore, can be a dynamic and unique response to the particular interaction, rather than an existing static HTML page.

Overview of servlets

Servlets perform a wide range of functions, such as:

vA servlet can create and return an entire HTML web page, with dynamic content based on the nature of the client request.

vA servlet can create just a portion of an HTML web page embedded in an existing static HTML web page.

vA servlet can communicate with other resources on the server, including databases, other Java applications, and applications written in other languages.

vA servlet can handle connections with multiple clients, accepting input from and broadcasting results to the multiple clients. A servlet could, for example, be a multi-player game server.

vYou can develop a servlet that allows a client to upload an agent to the server where the server runs the servlet.

IBM’s WebSphereApplication Server provides the foundation for deploying and running your e-businessapplications. It provides a secure, reliable execution environment for Java servlets. You can build and test Java servlets for WebSphere,

© Copyright IBM Corp. 1997, 2000

129

Page 139
Image 139
IBM AS/400E manual Writing Java Servlets, Overview of servlets

AS/400E specifications

The IBM AS/400E, now more commonly known as IBM i, is a robust and versatile midrange server that has been designed to provide a comprehensive computing solution for businesses of all sizes. First introduced in the late 1980s, the AS/400 series has undergone multiple enhancements and rebranding, with the AS/400E being one of the notable iterations. This powerful platform is closely associated with IBM's commitment to reliability, scalability, and integrated business solutions.

One of the main features of the AS/400E is its highly integrated architecture that combines hardware and software into a cohesive system. This integration allows for seamless operations, reducing the complexity typically associated with managing disparate systems. The system is powered by IBM's proprietary OS/400 operating system, which has evolved into IBM i, featuring advanced capabilities like object-oriented programming, integrated database management, and security features that are essential for enterprise environments.

A key characteristic of the AS/400E is its robust database support, primarily through the use of DB2 for i. This integrated database management system enables efficient data handling and retrieval, facilitating real-time business analytics and reporting. Furthermore, the platform supports a variety of programming languages, including RPG, COBOL, and Java, making it flexible for developers who require diverse tools for application development.

The AS/400E is also known for its exceptional reliability and uptime, making it a preferred choice for critical business applications in industries such as finance, healthcare, and manufacturing. This reliability is backed by advanced error detection and correction mechanisms, as well as redundancy features that help prevent data loss and minimize downtime.

In terms of scalability, the AS/400E can effortlessly expand to accommodate growing business demands. Organizations can increase processing power by adding more resources without significant disruption. This scalability, combined with the system’s built-in virtualization capabilities, allows businesses to optimize resource usage and streamline operations.

Security is another defining feature of the AS/400E. The platform incorporates various layers of security measures, including user authentication, encryption, and comprehensive auditing capabilities, ensuring that sensitive business data is protected against unauthorized access.

Overall, the IBM AS/400E remains a powerful tool in the enterprise computing landscape, providing businesses with an integrated, reliable, and secure solution for their technological needs. Its enduring popularity is a testament to its capability to evolve with changing business requirements while maintaining its core attributes of high performance and stability.