May 2001
Intermediate to advanced
1088 pages
30h 13m
English
Your custom tags can define scripting variables that are accessible to your Java Server Pages. In fact, you can even get the JSP engine to add a Java variable to the generated servlet to hold the value of your script variable. All you need to do is create a special TagExtraInfo class that describes the scripting variables your tag can define.
Listing 16.28 shows a subclass of TagExtraInfo that defines a scripting variable called scriptVar.
import javax.servlet.jsp.tagext.*; public class ScriptExtraInfo extends TagExtraInfo { public VariableInfo[] getVariableInfo(TagData data) { return new VariableInfo[] { new VariableInfo("scriptVar", "java.lang.String", true, ... |
Read now
Unlock full access