Chapter 23 Creating Java Servlets


Introduction to Java servlets

The Java Servlet API is a Java Standard Extension Java classes that extend the functionality of a Web server.

Use of servlets in Jaguar

Java servlets respond to HTTP requests from Web browser clients (or any other client that connects to Jaguar using the HTTP protocol). You can associate an HTTP URL with a servlet that you have installed in Jaguar. The servlet can dynamically create HTML documents, or act as a gateway between HTML-forms based applications and Jaguar components. For example, you might create servlets to:

Jaguar provides an extended version of the Servlet API so that servlets may use Jaguar services such as inter-server component invocations and database connection caching.

Java servlets versus Java components

Java servlets enhance the functionality offered by Java components, but do not replace Java components. Servlets in Jaguar can only be invoked by HTTP clients, and must return all output by writing to a ServletOutputStream instance. Typically, servlets are invoked from HTML pages loaded in a Web browser and return formatted HTML as their output.

Java components can be executed by any Jaguar client model, and can return complex objects in their natural format. To invoke Java components from a Web browser, you must create a Java applet that connects to Jaguar and instantiates proxy objects for the component.

Servlets can make use of some, but not all, Jaguar server-side services; for example, servlets can use cached database connections and can issue in-memory calls to components installed on the same server. Servlets cannot, however, participate in Jaguar transactions, except as a base client. Servlets cannot use other Jaguar server-side APIs besides connection caching and the Java ORB.

Java components have access to all Java server-side APIs and can participate in Jaguar transactions.

For more information

The JavaSoft Servlet Web pages describe how to code servlet classes.

 


Copyright © 2000 Sybase, Inc. All rights reserved.