11.8. Introducing Scripting Variables in the TLD File

In JSP 1.1, you override the getVariableInfo method of a TagExtraInfo class to declare scripting variables that your tag will introduce. The getVariableInfo method returns an array of VariableInfo objects. The VariableInfo constructor, in turn, takes four arguments:

  • The variable name (a String).

  • The variable’s type (a String representing a fully qualified class name or a class listed in the current page’s import statements).

  • A boolean indicating whether the variable should be declared (almost always true; this option supports future scripting in other languages).

  • An int indicating the variable’s scope (NESTED —available between the tag’s start and end tags, AT_BEGIN —available anytime after ...

Get More Servlets and JavaServer Pages™ 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.