Name

VariableInfo Class

Class name:

javax.servlet.jsp.tagext.VariableInfo

Extends:

None

Implements:

None

Implemented by:

Internal container-dependent class. Most containers use the reference implementation of the class (developed in the Apache Jakarta project).

Description

VariableInfo instances are created by TagExtraInfo subclasses to describe each scripting variable that the corresponding tag handler class creates.

Constructor

public VariableInfo(String varName, String className, boolean declare, int scope)

Creates a new instance with the specified values.

Methods

public String getClassName()

Returns the scripting variable’s Java type.

public boolean getDeclare()

Returns true if the web container creates a declaration statement for the scripting variable; otherwise, returns false (used if the variable has already been declared by another tag handler and is only updated by the tag handler corresponding to the TagExtraInfo subclass creating this VariableInfo instance).

public int getScope()

Returns one of AT_BEGIN (makes the scripting variable available from the start tag to the end of the JSP page), AT_END (makes the variable available from after the end tag to the end of the JSP page), or NESTED (makes the variable available only between the start and stop tags).

public String getVarName()

Returns the variable name.

Example

Here’s an example of a TagExtraInfo subclass for a custom action that creates a variable with the name specified by the id attribute and the Java type specified ...

Get JavaServer Pages Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.