variableinfo.html

来自「SUN公司官方J2EE中文帮助文档 应该不错 有兴趣的下来看看 html格式的」· HTML 代码 · 共 428 行 · 第 1/2 页

HTML
428
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Thu Jan 17 03:51:39 PST 2002 -->
<TITLE>
Java 2 Platform EE v1.3: Class  VariableInfo
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../javax/servlet/jsp/tagext/ValidationMessage.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="VariableInfo.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.servlet.jsp.tagext</FONT>
<BR>
Class  VariableInfo</H2>
<PRE>
java.lang.Object
  |
  +--<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 may have scope values
 of page, request, session, and application.

 <p>
 The class name (VariableInfo.getClassName) in the returned objects
 are used to determine the types of the scripting variables.
 Because of this, a custom action cannot create a scripting variable
 of a primitive type. The workaround is to use &quot;boxed&quot;
 types.

 <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.3 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 (will
 check if there is a JLS verbiage to refer to). The class must also
 be in the CLASSPATH for the Web Application (see Servlet 2.3
 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"/>

<p>
 The JSP 1.2 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:

 <ul>
 <li>
 for NESTED, after doInitBody and doAfterBody for a tag handler implementing
 BodyTag, and after doStartTag otherwise.
 <li>
 for AT_BEGIN, after doInitBody, doAfterBody, and doEndTag
 for a tag handler implementing BodyTag, and doStartTag and doEndTag otherwise.
 <li>
 for AT_END, after doEndTag method.
 </ul>

 <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 &lt;variable&gt; subelement of the
 &lt;tag&gt; element.  See the JSP specification.
<P>
<HR>

<P>
<!-- ======== INNER CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->

<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<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&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/servlet/jsp/tagext/VariableInfo.html#AT_BEGIN">AT_BEGIN</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/servlet/jsp/tagext/VariableInfo.html#AT_END">AT_END</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Scope information that scripting variable is visible after end tag</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../javax/servlet/jsp/tagext/VariableInfo.html#NESTED">NESTED</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Scope information that scripting variable is visible only within the start/end tags</TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?