November 2003
Intermediate to advanced
1488 pages
36h 35m
English
Custom tags may also define scripting variables to use within the JSP page. Scripting variables are used in processing JSP page content, just as variables would be in any Java implementation. The scripting variables can be referenced the same as JavaBeans: by using the getAttribute() and setAttribute() methods. To create a scripting variable, implement a class that extends the TagExtraInfo class as shown in the GreetingsTei.java file in Listing 18.6.
package com.tags; import javax.servlet.jsp.tagext.*; public class GreetingsTei extends TagExtraInfo { public GreetingsTei() {} public VariableInfo[] getVariableInfo(TagData data) { return new VariableInfo[] { new VariableInfo("bidderId","String",true, ... |
Read now
Unlock full access