Oracle JSP - Developers Guide
Release 1.0


PrevNext

1

Oracle JavaServer Pages (JSP) Basic Concepts

This preface introduces the basic concepts of Oracle JavaServer Pages (JSP) and discusses how Oracle JSP ensures a consistent runtime platform for your applications. Also provided is an overview of Oracle JSPs extensions which are built into Oracle JSP but not yet in the formal JSP specification. These extensions facilitate development and deployment of a web application.

This preface includes the following sections:


Section

"What is Oracle JSP?"
"Why Develop Using Oracle JSP?"
"Are the Oracle JSP Extensions Portable?"
"What Servers Support Oracle JSP?"
"Getting Help"

What is Oracle JSP?

Oracle JSP is a complete implementation of the Java Software JavaServer Pages 1.0 specification.

Consistent semantics

Oracle will soon provide four distinct servers that are capable of supporting Oracle JSPs: Oracle8i or Jserver, Oracle8i Lite, Oracle Application Server (OAS) 4.0.8.1, and Oracle WebDB 3.0.

Oracle JSP is designed to run in each of these environments providing consistent semantics regardless of your choice of server. This design has the added benefit of extending beyond Oracle servers. Oracle JSP runs in any server environment supporting Java Servlets (2.0 or higher) which greatly expands your options for using a convenient development server while still being assured that JSPs behave consistently on your target Oracle servers. Currently, non-Oracle servers known to be in use by Oracle JSP developers include Apache and Java Software's JSWDK.

Server independence is what makes Oracle JSP different from most other JSP implementations. Most JSP implementations are server specific which means that the JSP runtime only runs on a single server platform. JSP portability is achieved by specifying the semantics that the server platform must expose to the JSP runtime, as well as the semantics the JSP runtime provides to the page. The server semantics are defined by the Java Software Servlet specification. The page semantics are defined by the Java Software JSP specification. As the latter relies on the former, Java Software has had to tie versions of the Servlet specification with versions of the JSP specification. According to Java Software, JSP 1.0 requires a Servlet 2.1(b) implementation. The (b) indicates clarifications or semantical changes that were made to the Servlet specification post 2.1. Specifically, JSPs require that all servers implement if JSP portability is to be achieved. JSPs, therefore are supposed to only run on new revisions of servers.

Unfortunately, in the real world, you may not be allowed to upgrade a deployed server just because a new release with extended function is available. The additional reality is it takes time for servers to catch up. There are still semantical variations between servers supporting Servlet 2.1b that affects the behavior of your JSP page. Oracle JSP overcomes these issues first and foremost by being both server and servlet implementation independent. First, you can now run the same JSP runtime on the customer's server of choice. Second, it provides Servlet 2.1b emulation whenever the underlying servlet engine falls short.

Easy deployment

The JSP 1.0 specification doesn't define how a JSP application is packaged and deployed on a target server. JSP applications have distinct semantics from plain JSP pages primarily with regards to runtime isolation. JSP applications run in distinct contexts ensuring separation and isolation of application data. Typically, a stateful collection of JSP pages are deployed as a JSP application. Plain JSP pages run in the same context. Typically, stateless JSP pages are deployed as plain pages.

According to the JSP 1.0 specification, the way in which one configures a JSP application is server dependent. Note that on pre-existing servers, such as Apache, server independence may not even be supported.

Oracle JSP provides a simple mechanism that relies on file system structure rather than deployment descriptors for deploying JSP applications. By structuring the pages, content, and code libraries according to a few simple rules, Oracle JSP provides application semantics that work on all servers and require no manual server configuration or administration.

For more information. see "Chapter 4, Developing Web Applications."

Scripted events

Stateful JSPs have a lifecycle that extends beyond a single request. This lifecycle is managed by the server. A set of requests from the same user (client) are managed in an HTTP session. All requests (regardless of the user) that are directed to a registered set of pages are managed in a servlet context (JSP application). Properly implemented applications commonly need to be notified when a state transition occurs. For example, applications often want to acquire resources when an HTTP session begins and want to release resources when the session ends. Likewise, an application might want to restore or save persistent data when an application starts or is terminated.

Servlet runtimes use events to notify clients of these state transitions. Unfortunately, the JSP 1.0 specification doesn't expose these events to the JSP developer. Additionally, even if it did, event notification is limited to session termination which is all that is defined by the servlet runtime.

Oracle JSPs supports four events:

The JSP developer writes event handlers in a special JSP page named globals.jsa for whichever events it the server must respond to.

For more information, see "Chapter 4, Developing Web Applications."

JML (JSP Markup Language)

Although JSPs lineage includes Active Server Pages (ASPs), Java is the primary language and in a lot of cases the only scripting language which is a barrier to many web application developers and assemblers. For those developers not yet proficient in Java or who are more comfortable using a templating language such as Allaire's ColdFusion CFML, Oracle JSP provides an alternative, JSP Markup Language (JML). JML is an additional set of JSP tags supported by Oracle JSP that let you script your JSP page without having to write Java statements. JML provides tags for variable declarations, control flow, loops, setting object values, calling objects, and so on.

For more information, see "Chapter 6: JML: Developing JSPs without Java."

XML/XSL integration

Though JSPs are commonly used to dynamically generate HTML pages, the JSP syntax can be used to generate any text based MIME type. In particular, it can be used to dynamically create an XML document or an XSL stylesheet. When used to create an XML document, a developer often wants to apply a stylesheet to the XML data prior to returning the result from the server. In JSPs, this is more difficult than it sounds as the standard output stream provided to the page writes its output directly back through the server.

Oracle JSPs implementation provides a JML tag to express that a portion of the page should be transformed using a stylesheet before it is ouput. This has the added benefit that distinct portions of the page can be transformed via an XSL engine which lets you apply different stylesheets to different sets of data created by the JSP.

For more information, see "Chapter 7: XML/XSL and JSPs."

SQLJ

Dynamic server pages are commonly constructed from data residing in (Oracle) databases. JSPs however define no built-in support for facilitating database access. JSP developers must rely on calling Java's JDBC interfaces or a custom set of database beans. SQLJ is a standard mechanism for embedding static SQL operations in Java code. SQLJ greatly simplifies database access programming. Oracle JSP supports SQLJ programming in JSP scriptlets.

For more information, see "Chapter 8: SQLJ: Developing JSPs using SQLJ."

Why Develop Using Oracle JSP?

Oracle JSP is the JSP implementation for Oracle servers. Although JSPs conforming to the JSP 1.0 specification are transportable to any JSP server or environment, there are several benefits to developing on the same runtime as your deployment server even when these runtimes run on different server (types).

Consistency

The unfortunate reality is that software ships with bugs. Although in theory a JSP will run the same or all JSP implementations, bugs will provide some variation. A major benefit of Oracle JSP is it is server independent which lets you use the development server of your choice and be assured that the application will behave consistently when deployed.

Valuable extensions

JSP is still a young technology. The JSP specification will evolve and mature over time once real world development experience is gained. Oracle JSP anticipates a number of these extensions being expanded over time and learning from the ASP (Active Server Pages) market and elsewhere.

Are the Oracle JSP Extensions Portable?

Oracle plans to have Oracle JSP running on all Oracle servers in the near future. For now, you can safely use the Oracle JSP extensions for applications that are earmarked for Oracle installations. If your deployment server is not Oracle you can still take advantage of the Oracle JSP extensions because the Oracle JSP engine is server independent. Applications can run using Oracle JSP extensions providing that Oracle JSP is installed on the server.


What Servers Support Oracle JSP?

The simple answer is Oracle JSP is supported on all webservers that support Java Servlets built to the 2.0 or higher specification. However, no server currently ships with Oracle JSP. Oracle server products, Oracle8i or JServer, Oracle8i Lite, Oracle Application Server (OAS), and Oracle WebDB 3.0 are all in release cycles where the technology is being incorporated but is not yet released. The same is true for Oracle tools. Support for developing JSPs (using Oracle JSP) are being incorporated into Oracle JDeveloper. To determine the target release version for the server or tool of your choice, contact your Oracle representative.

Although Oracle products are not currently shipping JSPs, you can get started developing JSP applications. Oracle JSP is available for free as a download on the Oracle Technology Network site at http://technet.oracle.com/. If your development server meets the minimum requirements for supporting Java Servlet built to the 2.0 specification, Oracle JSP should run in your environment. Currently we have verified that Oracle JSPs run in the following environments:
Apache 1.0, Java Software's JSWDK 1.0, the upcoming OAS 4.0.8.1 release, the upcoming JDeveloper 3.0 release and development versions of Oracle WebDB, Oracle8i Lite, and Oracle8i or JServer.

For more information on installing and configuring Oracle JSP, see "Chapter 2: Installing and Configuring Oracle JSP."


Getting Help

An Oracle JSP discussion group is maintained in the Support section on the Oracle technology network (OTN).

Java Software also maintains a very active discussion group for JSPs called jsp-interest. To subscribe, send an e-mail to listserv@java.sun.com with subscribe jsp-interest yourlastname yourfirstname in the body of the message. Because this list is active it is recommended you subscribe to receive a daily digest or the posted e-mails. To do this add the following line after the line described above in the body of your message: set jsp-interest digest.


Prev

Next

Oracle
Copyright © 1999 Oracle Corporation.
All Rights Reserved.

 


Contents


Index