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

📄 package-summary.html

📁 struts api,学习使用struts必备的文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!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 Mar 09 15:31:21 GMT 2006 -->
<TITLE>
Apache Struts API Documentation: Package org.apache.struts.taglib.logic
</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="#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/html/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/struts/taglib/nested/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>
<H2>
Package org.apache.struts.taglib.logic
</H2>
The "struts-logic" tag library contains tags that are useful in managing
conditional generation of output text, looping over object collections
for repetitive generation of output text, and application flow management.
<P>
<B>See: </B>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="#package_description"><B>Description</B></A>
<P>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Class Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="CompareTagBase.html">CompareTagBase</A></B></TD>
<TD>Abstract base class for comparison tags.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="ConditionalTagBase.html">ConditionalTagBase</A></B></TD>
<TD>Abstract base class for the various conditional evaluation tags.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="EmptyTag.html">EmptyTag</A></B></TD>
<TD>Evalute the nested body content of this tag if the specified value is empty for this request.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="EqualTag.html">EqualTag</A></B></TD>
<TD>Evaluate the nested body content of this tag if the specified variable and value are equal.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="ForwardTag.html">ForwardTag</A></B></TD>
<TD>Perform a forward or redirect to a page that is looked up in the configuration information associated with our application.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="GreaterEqualTag.html">GreaterEqualTag</A></B></TD>
<TD>Evaluate the nested body content of this tag if the specified variable is greater than or equal to the specified value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="GreaterThanTag.html">GreaterThanTag</A></B></TD>
<TD>Evaluate the nested body content of this tag if the specified variable is greater than the specified value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="IterateTag.html">IterateTag</A></B></TD>
<TD>Custom tag that iterates the elements of a collection, which can be either an attribute or the property of an attribute.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="IterateTei.html">IterateTei</A></B></TD>
<TD>Implementation of <code>TagExtraInfo</code> for the <b>iterate</b> tag, identifying the scripting object(s) to be made visible.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="LessEqualTag.html">LessEqualTag</A></B></TD>
<TD>Evaluate the nested body content of this tag if the specified variable is less than or equal to the specified value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="LessThanTag.html">LessThanTag</A></B></TD>
<TD>Evaluate the nested body content of this tag if the specified variable is less than the specified value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="MatchTag.html">MatchTag</A></B></TD>
<TD>Evalute the nested body content of this tag if the specified value is a substring of the specified variable.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="MessagesNotPresentTag.html">MessagesNotPresentTag</A></B></TD>
<TD>Evalute the nested body content of this tag if the specified value is not present for this request.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="MessagesPresentTag.html">MessagesPresentTag</A></B></TD>
<TD>Evalute to <code>true</code> if an <code>ActionMessages</code> class or a class that can be converted to an <code>ActionMessages</code> class is in request scope under the specified key and there is at least one message in the class or for the property specified.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="NotEmptyTag.html">NotEmptyTag</A></B></TD>
<TD>Evalute the nested body content of this tag if the specified value is not empty for this request.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="NotEqualTag.html">NotEqualTag</A></B></TD>
<TD>Evaluate the nested body content of this tag if the specified variable and value are not equal.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="NotMatchTag.html">NotMatchTag</A></B></TD>
<TD>Evalute the nested body content of this tag if the specified value is not a substring of the specified variable.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="NotPresentTag.html">NotPresentTag</A></B></TD>
<TD>Evalute the nested body content of this tag if the specified value is not present for this request.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="PresentTag.html">PresentTag</A></B></TD>
<TD>Evalute the nested body content of this tag if the specified value is present for this request.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="RedirectTag.html">RedirectTag</A></B></TD>
<TD>Generate a URL-encoded redirect to the specified URI.</TD>
</TR>
</TABLE>
&nbsp;

<P>
<A NAME="package_description"><!-- --></A><H2>
Package org.apache.struts.taglib.logic Description
</H2>

<P>
<p>The "struts-logic" tag library contains tags that are useful in managing
conditional generation of output text, looping over object collections
for repetitive generation of output text, and application flow management.
</p>
<a name="doc.Description"></a>

<p>  </p>
<div align="Center"> <a href="#doc.Introduction">[Introduction]</a>
 <a href="#doc.Functionality">[Logic   Functionality]</a>
 <a href="#doc.Properties">[Logic Properties]</a>
 <a href="#doc.Examples">[Logic   Examples]</a>
 </div>

<p></p>

<hr /=""> <a name="doc.Intro"></a>

<h3>Introduction<a name="doc.Introduction"></a>
</h3>

<p>     The Logic library supplies tags that are useful for manipulating
presentation logic     without the use of scriptlets.</p>
<p><br>
</p>
<div align="Center"><img src="doc-files/logicUML.gif" alt="Logic Tag UML" >
<br>
   </div>
<p></p>
   <a name="doc.Functionality"></a>

<h3>Logic Tag Functionality<a name="doc.Functionality"></a>
</h3>

<p> The functionality of the logic tags can be divided into four groups:</p>

<p><b>Value Comparisons -</b> The purpose of these tags is to print out the
body   of the tag if the comparison evaluates to <i>true. </i></p>

<ul>
   <li><b><a href="../../../../../../userGuide/struts-logic.html#equal">equal,</a>
 <a href="../../../../../../userGuide/struts-logic.html#notEqual">notEqual</a>
    </b>   </li>
   <li><b><a href="../../../../../../userGuide/struts-logic.html#greaterEqual">greaterEqual</a>
, <a href="../../../../../../userGuide/struts-logic.html#lessEqual">lessEqual</a>
    </b></li>
   <li><b><a href="../../../../../../userGuide/struts-logic.html#greaterThan">greaterThan</a>
,<a href="../../../../../../userGuide/struts-logic.html#lessThan">     lessThan</a>
    </b></li>

</ul>

<p><b>Substring Matching -</b> The purpose of these tags is to match substrings
  inside of other Strings</p>

<ul>
   <li><b><a href="../../../../../../userGuide/struts-logic.html#match">match</a>
, <a href="../../../../../../userGuide/struts-logic.html#notMatch">notMatch</a>
    </b></li>

</ul>

<p><b>Presentation Location -</b> The purpose of these tags is to change
the location   of the presentation page</p>

<ul>
   <li><a href="../../../../../../userGuide/struts-logic.html#forward"><b>forward</b></a>
  </li>
   <li><a href="../../../../../../userGuide/struts-logic.html#redirect"><b>redirect</b></a>
  </li>

</ul>

<p><b>Collection Utilities -</b>The purpose of these tags is to handle Collections</p>

<ul>
   <li><a href="../../../../../../userGuide/struts-logic.html#iterate"><b>iterate</b></a>
 </li>

</ul>

<h3>Logic Tag Properties<a name="doc.Properties"></a>
</h3>

<p>Each of the four groups of logic tags have a common set of attributes
associated   with them. :</p>

<blockquote>
  <p><b>Value Comparisons</b> (equal, notEqual, greaterEqual, lessEqual,
greaterThan,     lessThan, present, notPresent)</p>

  <p>Each of the value comparison tags takes a <i>value</i> and compares
it to     the value of a comparison attribute. If the value given can be
successfully     converted to a <i>float</i> or <i>double</i>, then a number
comparison is     performed on the value given and the value of the comparison
attribute. Otherwise     a String comparison is performed. You have to specify
one of the comparison     attributes: <i>cookie</i>, <i>header</i>, <i>parameter</i>
, <i>property</i>     or <i>name. </i>For each of the examples, the tag "<i>
someComparisonTag"</i>can     be replaced by any of the value comparison
tags.</p>

  <ul>
     <li>value - the value to which this tag is going to compare, used in
conjunction       with one of the comparison attributes: <i>cookie</i>, <i>
header</i>, <i>parameter</i>,       <i>and property</i> and/or <i>name. </i></li>
     <li>cookie - the name of the cookie to compare to <i>value</i>

      <ul>
         <li>example:
          <pre>&lt;logic:<i>someComparisonTag</i> value="someUserName" cookie="userName"&gt;<br>  User Logged In<br>&lt;/logic:<i>someComparisonTag</i>&gt;<br></pre>
         </li>

      </ul>
     </li>
     <li>header - the name of the HTTP header to compare to <i>value</i>

      <ul>
         <li>example:
          <pre>&lt;logic:<i>someComparisonTag</i> value="en_US" header="Accept-Language"&gt;<br>  Welcome English-speaking User*<br>&lt;/logic:<i>someComparisonTag</i>&gt;<br></pre>
         </li>
         <li>
          <p>*Note: See the section in the user's guide on <a href="../../../../../../userGuide/building_view.html#i18n">
Internationalized             Messages</a>
 to do things like this better.</p>
         </li>

      </ul>
     </li>
     <li>name - the variable to be compared to <i>value</i> is the JSP bean
specified       by this attribute, if property is not specified, or the value
of the specified       property of this bean, if property is specified.

      <ul>
         <li>example:
          <pre>&lt;%<br>  String testString = "pantalones";<br>  pageContext.setAttribute("testString", testString, PageContext.PAGE_SCOPE);<br>%&gt;<br>&lt;jsp:useBean id="testString" scope="page" type="java.lang.String" /&gt;<br>&lt;logic:<i>someComparisonTag</i> name="testString" value="pantalones"&gt;<br>  Usted tiene pantalones!<br>&lt;/logic:<i>someComparison</i>&gt;<br></pre>
         </li>

      </ul>
     </li>

⌨️ 快捷键说明

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