Oracle JavaServer Pages Developer's Guide and Reference Release 8.1.7 Part Number A83726-01 |
Library | Service | Contents | Index

## JML Compile-Time Versus Runtime Considerations and Logistics

This section discusses two aspects of compile-time tag libraries compared to runtime tag libraries:

- general considerations in when it may be advantageous to use a compile-time tag library implementation (for any library, not just JML)

- the `taglib` directive required for the compile-time JML implementation in particular

### General Compile-Time Versus Runtime Considerations

The Sun Microsystems JavaServer Pages Specification, Version 1.1, describes a runtime support mechanism for custom tag libraries. This mechanism, using an XML-style tag library description file to specify the tags, is covered in "Standard Tag Library Framework".

Creating and using a tag library that adheres to this model assures that the library will be portable to any standard JSP environment.

There are, however, reasons to consider compile-time implementations:

- A compile-time implementation may produce more efficient code.

- A compile-time implementation allows the developer to catch errors during translation and compilation, instead of the end-user seeing them at runtime.

In the future, Oracle may offer a general framework for creating custom tag libraries with compile-time tag implementations. Such implementations would depend on the OracleJSP translator, so would not be portable to other JSP environments.

The general advantages and disadvantages of compile-time implementations apply to the Oracle JML tag library as well. There may be situations where it is advantageous to use the compile-time JML implementation as first introduced in older versions of OracleJSP. There are also a few additional tags in that implementation, and some additional expression syntax that is supported. (See "JML Compile-Time/1.0.0.6.x Syntax Support" and "JML Compile-Time/1.0.0.6.x Tag Support".)

It is generally advisable, however, to use the JML runtime implementation that adheres to the JSP 1.1 specification.

### The taglib Directive for Compile-Time JML Support

The OracleJSP 1.0.0.6.x/compile-time JML support implementation uses a custom class supplied by Oracle, `OpenJspRegisterLib`, to implement JML tag support.

In a JSP page using JML tags with the compile-time implementation, the `taglib` directive must specify the fully qualified name of this class (as opposed to specifying a TLD file as in standard JSP 1.1 tag library usage).

Following is an example:

    <%@ taglib uri="oracle.jsp.parse.OpenJspRegisterLib" prefix="jml" %>

For information about usage of the taglib directive for the JML runtime implementation, see "The taglib Directive".

| Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
Library | Service | Contents | Index