⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 package-summary.html

📁 struts api,学习使用struts必备的文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
    </tr>
    <tr>
      <td>nested:notEqual</td>
      <td><code>logic:notEqual</code> extension.</td>
    </tr>
    <tr>
      <td>nested:greaterEqual</td>
      <td><code>logic:greaterEqual</code> extension.</td>
    </tr>
    <tr>
      <td>nested:greaterThan</td>
      <td><code>logic:greaterThan</code> extension.</td>
    </tr>
    <tr>
      <td>nested:lessEqual</td>
      <td><code>logic:lessEqual</code> extension.</td>
    </tr>
    <tr>
      <td>nested:lessThan</td>
      <td><code>logic:lessThan</code> extension.</td>
    </tr>
    <tr>
      <td>nested:match</td>
      <td><code>logic:match</code> extension.</td>
    </tr>
    <tr>
      <td>nested:notMatch</td>
      <td><code>logic:notMatch</code> extension.</td>
    </tr>
    <tr>
      <td>nested:present</td>
      <td><code>logic:present</code> extension.</td>
    </tr>
    <tr>
      <td>nested:notPresent</td>
      <td><code>logic:notPresent</code> extension.</td>
    </tr>
  </tbody>
</table>
</p>
<br />
<p><b>Basic tags</b> (usually a tag which has no body content)
<table border="1">
  <tbody>
    <tr>
      <th>markup name</th>
      <th>brief description</th>
    </tr>
    <tr>
      <td>nested:checkbox</td>
      <td><code>html:</code> extension.</td>
    </tr>
    <tr>
      <td>nested:hidden</td>
      <td><code>html:hidden</code> extension.</td>
    </tr>
    <tr>
      <td>nested:define</td>
      <td><code>bean:define</code> extension.</td>
    </tr>
    <tr>
      <td>nested:image</td>
      <td><code>html:image</code> extension.</td>
    </tr>
    <tr>
      <td>nested:img</td>
      <td><code>html:img</code> extension.</td>
    </tr>
    <tr>
      <td>nested:link</td>
      <td><code>html:link</code> extension.</td>
    </tr>
    <tr>
      <td>nested:message</td>
      <td><code>bean:message</code> extension.</td>
    </tr>
    <tr>
      <td>nested:multibox</td>
      <td><code>html:multibox</code> extension.</td>
    </tr>
    <tr>
      <td>nested:options</td>
      <td><code>html:options</code> extension.</td>
    </tr>
    <tr>
      <td>nested:optionsCollection</td>
      <td><code>html:optionsCollection</code> extension.</td>
    </tr>
    <tr>
      <td>nested:password</td>
      <td><code>html:password</code> extension.</td>
    </tr>
    <tr>
      <td>nested:radio</td>
      <td><code>html:radio</code> extension.</td>
    </tr>
    <tr>
      <td>nested:select</td>
      <td><code>html:select</code> extension.</td>
    </tr>
    <tr>
      <td>nested:size</td>
      <td><code>bean:size</code> extension.</td>
    </tr>
    <tr>
      <td>nested:submit</td>
      <td><code>html:submit</code> extension.</td>
    </tr>
    <tr>
      <td>nested:text</td>
      <td><code>html:text</code> extension.</td>
    </tr>
    <tr>
      <td>nested:textarea</td>
      <td><code>html:textarea</code> extension.</td>
    </tr>
    <tr>
      <td>nested:write</td>
      <td><code>bean:write</code> extension.</td>
    </tr>
  </tbody>
</table>
</p>
<hr><a name="doc.PropertyProperty"></a>
<h3>The relative references and the "property" property.</h3>
<p>Use of the "property" property is exactly the same as the original Struts
  tag    with minor addition. Appends the provided property to the nested
property  of   the tags that surround it. You can use additional nesting
(use "dot notation")   within the provided property as the current struts
system allows but there is   now a tag which can provide this in a "cleaner"
fashion.  :)</p>
<p>The one other addition to the "property" property, is the ability to step 
    backwards in the heirarchy in the familiar directory fashion;   e.g. "../../myPropertyName"</p>
<p>As expected this allows you to step backwards in the nested model to access 
    a higher level in the object tree. The implementation uses the StringTokenizer 
    working off the "/" delimiter and counts the tokens. This was going to
  be   denied, enforcing the ".." fashion, but on consideration, allowed
for   some   easier-to-read naming possibilities.</p>
<p>Consider "propertyOne.propertyTwo.propertyThree.propertyFour". With the
     current nesting level beneath "propertyFour" you can instead use   "two/three/four/anotherProperty"
  which is easier to understand than   "../../../anotherProperty". Doesn't
 sound like much, but makes life easier   when traversing large jsp pages
for tags defining your object model.</p>
<p>Also implemented is the also familiar directory fashion of a leading "/"
  to   reference from the root of the model and start over. e.g. "/propertyOne". 
    This allow a convenient way to move around a few levels as well as "forking" 
    in the object structure among other felixble approaches to structure.</p>
<p><b>Parent References...</b><br />
       "property" properties, including the relative properties described 
above,  all    end up referencing a property of a child bean. For example 
"/myProperty"  will   return an object from the "myProperty" of the root bean.
The fact that a   property is specified means that you are accessing the
result of that   property. This results in never being able to properly access
a parent object   itself within its current related context.   </p>
<p>   Take for example you simply want to print out a list of String objects.
  In a    bean you create a list of them, offer them out to the system via
 a getter, and   you markup using the nested:iterate or logic:iterate tag
(both contain the    same issues). The only way to get at the object itself
is get the iterate tag   to declare a scripting variable. With the nested
tags you can now simply   reference the object using a parent reference of
"./" or "this/". Any property   ending in the "/" will be treaded as a parent
reference. So if you use   "parent/" as your property, it will step back
one parent and use this block's   parent. The special cases to use the parent
of the current nested block are   "./" or "this/". Not just the iterate tag,
this will return the object   represented by any nested parent tag.   </p>
<p>   This allows you to be in a nested tag block and use the custom tags
  work    directly against the parent defined object, indexed or otherwise.
  So to be in    an iterate block, and to print out the String representation
  of the current    iterated object, you can now use...   </p>
<pre>eg:<br>  &lt;nested:iterate property="myItemList" &gt;<br>    &lt;html:write property="this/" &gt;&lt;br&gt;<br>  &lt;/html:iterate&gt;</pre>
<p>   or if you want to print the string value of a parent the other side
  of the    object...   </p>
<pre>eg:<br>  &lt;nested:iterate property="myBeanList" &gt;<br>    &lt;nested:iterate property="myItemList" &gt;<br>      &lt;html:write property="beanListObject/" &gt;&lt;br&gt;<br>    &lt;/html:iterate&gt;<br>  &lt;/html:iterate&gt;</pre>
<p>   The fact that it didn't use the special cases of "./" or "this/" means
  that it   steps back in the hierarchy as a typical relative reference.
This   is unlimited   the amount of steps you can take back in the hierarchy.
For   example, to go   back three parents your property would be "one/two/three/". 
    </p>
<p><b>Note:</b> The logic identifies the leading "/" and then reads the property 
    from the last index of "/".  Resulting in "/three/four/anotherProperty"
  working   the same as "/anotherProperty".</p>
<p><b>Note:</b> If you're busily nesting away, and a parent tag has a leading
  "/"   property, the  contained tags will append to this new structure.
Handy,   but   you have to keep it in mind.</p>
<p><b>Note:</b> If you try to reference beneath the level of the nesting,
  it will   simply act like as if a leading "/" property was defined.</p>
<p><b>Parent Reference Note:</b>   The only thing to keep in mind with parent
  references is that   you cannot parent reference the root bean. This is
because  the resulting   property would be an empty string. Something that
the BeanUtils/PropertyUtils    cannot handle (if this is a requirement, you
could use a "fake nested   property". A getter which simply returns the same
bean instance ("this")  and   simply add an extra <code>nested:nest</code>
  level at the start of your   hierarchy. Works just fine).   </p>
<hr><br />
<img src="doc-files/nestedUML.gif" alt="nested UML">
<a name="doc.ImplementationDetails"></a>
<h3>Implementation Details.</h3>
<b>NestedPropertyHelper</b>
<dir>
<p>This class embodies all of the logic that runs the nested tagging system.
  It   defines a static method, "setNestedProperties", which the nested tags
  pass   themselves into to have their appropriate properties set.</p>
<p>The tag extensions themselves implement options of three interfaces which 
    define functionality for the various types of nested usage. When traversing 
    the tag hierarchy back up to the root of the structure, these tags define
  the   result of the current tag.</p>
</dir>
<b>NestedTagSupport Interface...</b>
<dir>
<p>This is the base of the interfaces. Simply put, any tag that we need to
  single   out of the standard struts tags for use by the nesting system
can   implement   this or its children.</p>
</dir>
<b>NestedPropertySupport Interface...</b>
<dir>
<p>Tags that implement this interface will have the provided property attribute 
    appended to the parenting nested attribute. This is the heart of the matter.
    </p>
<p>This is the basic property, and so far all the nested tags support this 
    to have their nested properties written correctly.</p>
</dir>
<b>NestedNameSupport Interface...</b>
<dir>
<p>This interface means that the implementing tag wants to have it's name
  tag   looked after by the nesting system. This is automatic, and the name
  is written   for the tag from the root tag. If the JSP is a form, then
it   will look to the   form tag and get a hold of the bean name that is
defined   in the   struts-config.xml file for the action, otherwise, a nested:root
 tag must be   provided for this means.</p>
<p>This extends the NestedPropertySupport interface as, at time of writing, 
    all tags which used a "name" attribute, required a property attribute 
in some   way to make it useful. This could change, and it's only a small 
refactoring to   make it work for the instance if it's relevant for nesting.</p>
<p><b>Note:</b> At the moment, if the tag implements this interface, the
name   attribute will be rewritten by the system on all counts. I find it
hard to   picture a valid requirement for inter-mixing multiple object structures
  (which   distinguishable names would allow) in the one JSP page which couldn't
  be   more efficiently provided by the current nesting model working over
 the one   model. Time may prove this idea wrong.</p>
</dir>
<b>ParentTagSupport</b>
<dir>
<p>This tag identifies for the system those tags which define levels in the 
    nested heirarchy.  Namely the "getNestedProperty()" method that yields
  to   calling tags the fully qualified nested property of the parent tag.
 In the   case of a NestedIterator being the parent tag, it will also append
 the current   index reference. e.g. propertyOne.propertyTwo[5]</p>
</dir>
<br />
<br />
<br />
<br />
<P>
<HR>

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_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="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&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="../../../../../org/apache/struts/taglib/logic/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/struts/taglib/nested/bean/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="package-summary.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
Copyright 

⌨️ 快捷键说明

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