?? variableinfo.html
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.4.2) on Thu Oct 16 19:57:35 EDT 2003 --><TITLE>VariableInfo (JavaServer Pages API Documentation)</TITLE><META NAME="keywords" CONTENT="javax.servlet.jsp.tagext.VariableInfo class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="VariableInfo (JavaServer Pages API Documentation)";}</SCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/VariableInfo.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../javax/servlet/jsp/tagext/ValidationMessage.html" title="class in javax.servlet.jsp.tagext"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="VariableInfo.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">javax.servlet.jsp.tagext</FONT><BR>Class VariableInfo</H2><PRE>java.lang.Object <IMG SRC="../../../../resources/inherit.gif" ALT="extended by"><B>javax.servlet.jsp.tagext.VariableInfo</B></PRE><HR><DL><DT>public class <B>VariableInfo</B><DT>extends java.lang.Object</DL><P>Information on the scripting variables that are created/modified by a tag (at run-time). This information is provided by TagExtraInfo classes and it is used by the translation phase of JSP. <p> Scripting variables generated by a custom action have an associated scope of either AT_BEGIN, NESTED, or AT_END. <p> The class name (VariableInfo.getClassName) in the returned objects is used to determine the types of the scripting variables. Note that because scripting variables are assigned their values from scoped attributes which cannot be of primitive types, "boxed" types such as <code>java.lang.Integer</code> must be used instead of primitives. <p> The class name may be a Fully Qualified Class Name, or a short class name. <p> If a Fully Qualified Class Name is provided, it should refer to a class that should be in the CLASSPATH for the Web Application (see Servlet 2.4 specification - essentially it is WEB-INF/lib and WEB-INF/classes). Failure to be so will lead to a translation-time error. <p> If a short class name is given in the VariableInfo objects, then the class name must be that of a public class in the context of the import directives of the page where the custom action appears. The class must also be in the CLASSPATH for the Web Application (see Servlet 2.4 specification - essentially it is WEB-INF/lib and WEB-INF/classes). Failure to be so will lead to a translation-time error. <p><B>Usage Comments</B> <p> Frequently a fully qualified class name will refer to a class that is known to the tag library and thus, delivered in the same JAR file as the tag handlers. In most other remaining cases it will refer to a class that is in the platform on which the JSP processor is built (like J2EE). Using fully qualified class names in this manner makes the usage relatively resistant to configuration errors. <p> A short name is usually generated by the tag library based on some attributes passed through from the custom action user (the author), and it is thus less robust: for instance a missing import directive in the referring JSP page will lead to an invalid short name class and a translation error. <p><B>Synchronization Protocol</B> <p> The result of the invocation on getVariableInfo is an array of VariableInfo objects. Each such object describes a scripting variable by providing its name, its type, whether the variable is new or not, and what its scope is. Scope is best described through a picture: <p> <IMG src="doc-files/VariableInfo-1.gif" alt="NESTED, AT_BEGIN and AT_END Variable Scopes"/><p> The JSP 2.0 specification defines the interpretation of 3 values: <ul> <li> NESTED, if the scripting variable is available between the start tag and the end tag of the action that defines it. <li> AT_BEGIN, if the scripting variable is available from the start tag of the action that defines it until the end of the scope. <li> AT_END, if the scripting variable is available after the end tag of the action that defines it until the end of the scope. </ul> The scope value for a variable implies what methods may affect its value and thus where synchronization is needed as illustrated by the table below. <b>Note:</b> the synchronization of the variable(s) will occur <em>after</em> the respective method has been called. <blockquote> <table cellpadding="2" cellspacing="2" border="0" width="55%" bgcolor="#999999" summary="Variable Synchronization Points"> <tbody> <tr align="center"> <td valign="top" colspan="6" bgcolor="#999999"><u><b>Variable Synchronization Points</b></u><br> </td> </tr> <tr> <th valign="top" bgcolor="#c0c0c0"> </th> <th valign="top" bgcolor="#c0c0c0" align="center">doStartTag()</th> <th valign="top" bgcolor="#c0c0c0" align="center">doInitBody()</th> <th valign="top" bgcolor="#c0c0c0" align="center">doAfterBody()</th> <th valign="top" bgcolor="#c0c0c0" align="center">doEndTag()</th> <th valign="top" bgcolor="#c0c0c0" align="center">doTag()</th> </tr> <tr> <td valign="top" bgcolor="#c0c0c0"><b>Tag<br> </b></td> <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, NESTED<br> </td> <td valign="top" align="center" bgcolor="#ffffff"><br> </td> <td valign="top" align="center" bgcolor="#ffffff"><br> </td> <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, AT_END<br> </td> <td valign="top" align="center" bgcolor="#ffffff"><br> </td> </tr> <tr> <td valign="top" bgcolor="#c0c0c0"><b>IterationTag<br> </b></td> <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, NESTED<br> </td> <td valign="top" align="center" bgcolor="#ffffff"><br> </td> <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, NESTED<br> </td> <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, AT_END<br> </td> <td valign="top" align="center" bgcolor="#ffffff"><br> </td> </tr> <tr> <td valign="top" bgcolor="#c0c0c0"><b>BodyTag<br> </b></td> <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, NESTED<sup>1</sup><br> </td> <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, NESTED<sup>1</sup><br> </td> <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, NESTED<br> </td> <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, AT_END<br> </td> <td valign="top" align="center" bgcolor="#ffffff"><br> </td> </tr> <tr> <td valign="top" bgcolor="#c0c0c0"><b>SimpleTag<br> </b></td> <td valign="top" align="center" bgcolor="#ffffff"><br> </td> <td valign="top" align="center" bgcolor="#ffffff"><br> </td> <td valign="top" align="center" bgcolor="#ffffff"><br> </td> <td valign="top" align="center" bgcolor="#ffffff"><br> </td> <td valign="top" align="center" bgcolor="#ffffff">AT_BEGIN, AT_END<br> </td> </tr> </tbody> </table> <sup>1</sup> Called after <code>doStartTag()</code> if <code>EVAL_BODY_INCLUDE</code> is returned, or after <code>doInitBody()</code> otherwise. </blockquote> <p><B>Variable Information in the TLD</B> <p> Scripting variable information can also be encoded directly for most cases into the Tag Library Descriptor using the <variable> subelement of the <tag> element. See the JSP specification.<P><P><HR><P><!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../javax/servlet/jsp/tagext/VariableInfo.html#AT_BEGIN">AT_BEGIN</A></B></CODE><BR> Scope information that scripting variable is visible after start tag.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -