Oracle JavaServer Pages Developer's Guide and Reference
Release 8.1.7

Part Number A83726-01

Library

Product

Contents

Index

Go to previous page Go to beginning of chapter Go to next page

JML Compile-Time/1.0.0.6.x Syntax Support

This section describes Oracle-specific bean reference syntax and expression syntax supported by the compile-time JML implementation, for specifying tag attribute values. The following topics are covered:

This functionality is not portable to other JSP environments.

JML Bean References and Expressions, Compile-Time Implementation

Generally speaking, a bean reference is any reference to a JavaBean instance (bean) that results in accessing either a property or a method of the bean. This includes a reference to a property or method of a bean where the bean itself is a property of another bean.

This becomes cumbersome, because standard JavaBeans syntax requires that properties be accessed by calling their accessor methods rather than by direct reference. For example, consider the following direct reference:

a.b.c.d.doIt()

This must be expressed as follows in standard JavaBeans syntax:

a.getB().getC().getD().doIt()

Oracle's compile-time JML implementation, however, offers abbreviated syntax.

JML Bean References

Oracle-specific syntax supported by the compile-time JML implementation allows bean references to be expressed using direct "." (dot) notation. Note that standard bean property accessor method syntax is also still valid.

Consider the following standard JavaBean reference:

customer.getName()

In JML bean reference syntax, you can express this in either of the following ways:

customer.getName()

or:

customer.name

JavaBeans can optionally have a default property, whose reference is assumed if no reference is explicitly stated. Default property names can be omitted in JML bean references. In the example above, if name is the default property, then the following are all valid JML bean references:

customer.getName()

or:

customer.name

or simply:

customer

Most JavaBeans do not define a default property. Of those that do, the most significant are the JML datatype JavaBeans described in "JML Extended Datatypes".

JML Expressions

JML expression syntax supported by the compile-time JML implementation is a superset of standard JSP expression syntax, adding support for the JML bean reference syntax documented in the preceding section.

A JML bean reference appearing in a JML expression must be enclosed in the following syntax:

$[JML_bean_reference]

Attribute Settings with JML Expressions

Tag attribute documentation under "JSP Markup Language (JML) Tag Descriptions" notes standard syntax that is portable. You can set attributes, as documented there, for either the runtime or the compile-time JML implementation and even for non-Oracle JSP environments.

If you intend to use only the Oracle-specific compile-time implementation, however, you can set attributes using JML bean references and JML expression syntax, as documented in "JML Bean References and Expressions, Compile-Time Implementation".

Note the following:



Go to previous page
Go to beginning of chapter
Go to next page
Oracle
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index