?? struts-logic-el.tld
字號:
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Id: struts-logic-el.tld 481833 2006-12-03 17:32:52Z niallp $
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE taglib PUBLIC
"-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
<taglib>
<tlib-version>1.3</tlib-version>
<jsp-version>1.2</jsp-version>
<short-name>logic</short-name>
<uri>http://struts.apache.org/tags-logic-el</uri>
<description>
<![CDATA[
<p>This 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>
<p>For tags that do value comparisons (equal, greaterEqual,
greaterThan, lessEqual, lessThan, notEqual), the following rules apply:</p>
<ul>
<li>The specified value is examined. If it can be converted successfully to a
double or a long, it is assumed that the ultimate comparison will be numeric
(either floating point or integer). Otherwise, a String comparison will be
performed.</li>
<li>The variable to be
compared to is retrieved, based on the selector
attribute(s) (cookie, header, name, parameter, property)
present on this tag. It will be converted to the appropriate type
for the comparison, as determined above.</li>
<li>If the specified variable or property returns null, it will be
coerced to a zero-length string before the comparison occurs.</li>
<li>The specific comparison for this tag will be performed, and the nested
body content of this tag will be evaluated if the comparison returns
a true result.</li>
</ul>
<p> For tags that do substring matching (match, notMatch), the following
rules apply:</p>
<ul>
<li>The specified variable is retrieved, based on the selector attribute(s)
(cookie, header, name, parameter, property) present on this tag.</li>
<li>The variable is converted to a String, if necessary.A request time
exception will be thrown if the specified variable cannot be retrieved, or has
a null value.</li>
<li>The specified value is checked for existence as a substring of the
variable, in the position specified by the location attribute, as follows: at
the beginning (if location is set to start), at the end (if location is set to
end), or anywhere (if location is not specified).</li>
</ul>
<p>Many of the tags in this tag library will throw a JspException at runtime
when they are utilized incorrectly (such as when you specify an invalid
combination of tag attributes). JSP allows you to declare an "error page" in
the <%@ page %> directive. If you wish to process the actual exception
that caused the problem, it is passed to the error page as a request attribute
under key org.apache.struts.action.EXCEPTION.</p>
<p>Struts-logic tags NOT implemented.</p>
<p>This library, a derivation of the normal "struts-logic" library, provides
the functionality of the Struts logic tags, but assumes the presence of the
JavaServer Pages Standard Library (JSTL), and uses the JSTL expression engine
(hereafter abbreviated in many places as just "el") to evaluate attribute
values instead of using JSP runtime expressions (sometimes called
"rtexprvalues").</p>
<p>Because it is assumed this library will be used with the JSTL and the new
EL engine, there are some tags in the struts-logic library which provide
functionality which is entirely subsumed by the JSTL. This section lists each
struts-logic tag which is NOT implemented in the struts-logic-el library, and
describes the JSTL tag which can be used instead of the Struts
tag.Struts-Logic TagJSTL Tag</p>
<p><code><logic:empty></code></p>
<p>This functionality is subsumed by the JSTL <c:if>, <c:when> tags and
the empty function in the JSTL EL.</p>
<p>Example: <c:if test="${empty var}">CONTENT</c:if></p>
]]>
</description>
<tag>
<name>forward</name>
<tag-class>org.apache.strutsel.taglib.logic.ELForwardTag</tag-class>
<body-content>empty</body-content>
<description>
<![CDATA[
<p><strong>
Forward control to the page specified by the specified ActionForward
entry.
</strong></p>
<p>Performs a <code>PageContext.forward()</code> or
<code>HttpServletResponse.sendRedirect()</code> call for the global
<code>ActionForward</code> entry for the specified name. URL
rewriting will occur automatically if a redirect is performed.</p>
]]>
</description>
<attribute>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<description>
<![CDATA[
<p>
The logical name of the global <code>ActionForward</code> entry
that identifies the destination, and forwarding approach, to be used.
<strong>Note</strong>: forwarding to Tiles definitions is not supported
from this tag. You should forward to them from an Action subclass.
</p>
]]>
</description>
</attribute>
</tag>
<tag>
<name>iterate</name>
<tag-class>org.apache.strutsel.taglib.logic.ELIterateTag</tag-class>
<tei-class>org.apache.struts.taglib.logic.IterateTei</tei-class>
<body-content>JSP</body-content>
<description>
<![CDATA[
<p><strong>
Repeat the nested body content of this tag over a specified collection.
</strong></p>
<p>Repeats the nested body content of this tag once for every element
of the specified collection, which must be an <code>Iterator</code>,
a <code>Collection</code>, a <code>Map</code> (whose values are to be
iterated over), or an array. The collection to be iterated over must be
specified in one of the following ways:</p>
<ul>
<li>As a runtime expression specified as the value of the
<code>collection</code> attribute.</li>
<li>As a JSP bean specified by the <code>name</code> attribute.</li>
<li>As the property, specified by the <code>property</code>, of the
JSP bean specified by the <code>name</code> attribute.</li>
</ul>
<p>The collection to be iterated over MUST conform to one of the following
requirements in order for iteration to be successful:</p>
<ul>
<li>An array of Java objects or primitives.</li>
<li>An implementation of <code>java.util.Collection</code>, including
<code>ArrayList</code> and <code>Vector</code>.</li>
<li>An implementation of <code>java.util.Enumeration</code>.</li>
<li>An implementation of <code>java.util.Iterator</code>.</li>
<li>An implementation of <code>java.util.Map</code>, including
<code>HashMap</code>, <code>Hashtable</code>, and
<code>TreeMap</code>. <strong>NOTE</strong> - See below for
additional information about accessing Maps.</li>
</ul>
<p>Normally, each object exposed by the iterate tag is an element
of the underlying collection you are iterating over. However, if you
iterate over a <code>Map</code>, the exposed object is of type
<code>Map.Entry</code> that has two properties:</p>
<ul>
<li>
<code>key</code> - The key under which this item is stored in the
underlying Map.</li>
<li>
<code>value</code> - The value that corresponds to this key.</li>
</ul>
<p>So, if you wish to iterate over the values of a Hashtable, you would
implement code like the following:</p>
<code><logic-el:iterate id="element" name="myhashtable"><br/>
Next element is <bean:write name="element" property="value"/><br/>
</logic-el:iterate>
</code>
<p>If the collection you are iterating over can contain <code>null</code>
values, the loop will still be performed but no page scope attribute
(named by the <code>id</code> attribute) will be created for that loop
iteration. You can use the <code><logic-el:present;gt;</code> and
<code><logic-el:notPresent></code> tags to test for this case.</p>
]]>
</description>
<attribute>
<name>collection</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
<![CDATA[
<p>A runtime expression that evaluates to a collection (conforming to
the requirements listed above) to be iterated over.</p>
]]>
</description>
</attribute>
<attribute>
<name>id</name>
<required>true</required>
<rtexprvalue>false</rtexprvalue>
<description>
<![CDATA[
<p>The name of a page scope JSP bean that will contain the current
element of the collection on each iteration, if it is not
<code>null</code>.</p>
]]>
</description>
</attribute>
<attribute>
<name>indexId</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>
<![CDATA[
<p>The name of a page scope JSP bean that will contain the current
index of the collection on each iteration.</p>
]]>
</description>
</attribute>
<attribute>
<name>length</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
<![CDATA[
<p>The maximum number of entries (from the underlying collection) to be
iterated through on this page. This can be either an integer that
directly expresses the desired value, or the name of a JSP bean (in
any scope) of type <code>java.lang.Integer</code> that defines the
desired value. If not present, there will be no limit on the number
of iterations performed.</p>
]]>
</description>
</attribute>
<attribute>
<name>name</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
<![CDATA[
<p>The name of the JSP bean containing the collection to be iterated
(if <code>property</code> is not specified), or the JSP bean whose
property getter returns the collection to be iterated (if
<code>property</code> is specified).</p>
]]>
</description>
</attribute>
<attribute>
<name>offset</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
<![CDATA[
<p>The zero-relative index of the starting point at which entries from
the underlying collection will be iterated through. This can be either
an integer that directly expresses the desired value, or the name of a
JSP bean (in any scope) of type <code>java.lang.Integer</code> that
defines the desired value. If not present, zero is assumed (meaning
that the collection will be iterated from the beginning.</p>
]]>
</description>
</attribute>
<attribute>
<name>property</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
<![CDATA[
<p>Name of the property, of the JSP bean specified by <code>name</code>,
whose getter returns the collection to be iterated.</p>
]]>
</description>
</attribute>
<attribute>
<name>scope</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>
<![CDATA[
<p>The bean scope within which to search for the bean named by the
<code>name</code> property, or "any scope" if not specified.</p>
]]>
</description>
</attribute>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -