sraeburn 2003/07/25 23:09:33 Modified: src/share/org/apache/struts/taglib/bean package.html src/share/org/apache/struts/taglib/logic package.html src/share/org/apache/struts/tiles package.html Log: Fixed broken links in Javadoc Revision Changes Path 1.7 +1 -1 jakarta-struts/src/share/org/apache/struts/taglib/bean/package.html Index: package.html =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/bean/package.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- package.html 19 May 2003 03:06:03 -0000 1.6 +++ package.html 26 Jul 2003 06:09:33 -0000 1.7 @@ -402,7 +402,7 @@ <p><em>Render A Bean or Bean Property</em> - The contents of a bean, or bean property, are converted to a String and then copied to the response currently being created. This tag understands the syntax for simple, nested, and indexed -property references described <a href="#doc.Properties.Reference"> above</a> +property references described <a href="#doc.Properties.References"> above</a> . Beans from any scope can be requested - by default, the scopes are searched in expanding visibility order (page, request, session, and application) to locate the requested bean.</p> 1.16 +124 -124 jakarta-struts/src/share/org/apache/struts/taglib/logic/package.html Index: package.html =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/logic/package.html,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- package.html 19 May 2003 03:31:22 -0000 1.15 +++ package.html 26 Jul 2003 06:09:33 -0000 1.16 @@ -1,25 +1,25 @@ <body> - + <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> @@ -29,15 +29,15 @@ </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> @@ -48,48 +48,48 @@ <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 + +<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> + +<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 @@ -99,52 +99,52 @@ , <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> - + <li>cookie - the name of the cookie to compare to <i>value</i> + <ul> - <li>example: + <li>example: <pre><logic:<i>someComparisonTag</i> value="someUserName" cookie="userName"><br> User Logged In<br></logic:<i>someComparisonTag</i>><br></pre> </li> - + </ul> </li> - <li>header - the name of the HTTP header to compare to <i>value</i> - + <li>header - the name of the HTTP header to compare to <i>value</i> + <ul> - <li>example: + <li>example: <pre><logic:<i>someComparisonTag</i> value="en_US" header="Accept-Language"><br> Welcome English-speaking User*<br></logic:<i>someComparisonTag</i>><br></pre> </li> - <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. - +of the specified property of this bean, if property is specified. + <ul> - <li>example: + <li>example: <pre><%<br> String testString = "pantalones";<br> pageContext.setAttribute("testString", testString, PageContext.PAGE_SCOPE);<br>%><br><jsp:useBean id="testString" scope="page" type="java.lang.String" /><br><logic:<i>someComparisonTag</i> name="testString" value="pantalones"><br> Usted tiene pantalones!<br></logic:<i>someComparison</i>><br></pre> </li> - + </ul> </li> <li>parameter - the name of the request parameter to compare to <i>value</i> - + <ul> - <li>example: + <li>example: <pre><logic:<i>someComparisonTag</i> value="" parameter="username"><br> Error: a username must be specified<br></logic:<i>someComparisonTag</i>><br></pre> </li> - + </ul> </li> <li>property - the variable to be compared with <i>value</i> is the @@ -157,11 +157,11 @@ by the name property, or "any scope" if not specified. Possible values are "page", "request", "session", "application", or "any scope" </li> - + </ul> - + <p><b>Substring Matching</b> (match, notMatch)</p> - + <p>The substring matching tags take all the same arguments as the value comparison tags. You compare the String specified by <i>value</i> to any of the comparison values you give it, specified by <i>cookie</i>, @@ -169,31 +169,31 @@ that in the examples, <i>matchTag</i> corresponds either the <i>match </i>or <i>notMatch</i> tag. Matching tags also have an additional <i> location</i> attribute added:</p> - + <ul> <li>location - has two possible values, "start" and "end". If -"start", the substring is attempted to be matched at the beginning +"start", the substring is attempted to be matched at the beginning of the String, if "end", then the substring is attempted to be matched -to the end of the String +to the end of the String <ul> - <li>example: + <li>example: <pre><logic:<i>matchTag</i> parameter="action" value="processLogin" location="start"><br> Processing Login....<br></logic:<i>matchTag</i>><br><br>In this example, a request parameter "action" was compared to see if<br>its value started with the String "processLogin". In this case,<br><i>matchTag</i> would have to be <logic:match>.<br></pre> </li> - + </ul> </li> - + </ul> - + <p><b>Presentation Location</b> (forward, redirect)</p> - + <p>The <i>redirect</i> tag is resposible for sending a re-direct to the client's browser, complete with URL-rewriting if it's supported by the -container. Its attributes are consistent with the Struts HTML <a href="../../../../../../struts-html.html#link"><code> +container. Its attributes are consistent with the Struts HTML <a href="../../../../../../userGuide/struts-html.html#link"><code> link</code></a> - tag. The base URL is calculated based on which of the following attributes + tag. The base URL is calculated based on which of the following attributes you specify (you must specify exactly one of them):</p> - + <ul> <li> forward - Use the value of this attribute as the name of a global ActionForward to be looked up, and use the context-relative URI found @@ -201,59 +201,59 @@ <li>href - Use the value of this attribute unchanged. </li> <li>page - Use the value of this attribute as a context-relative URI, and generate a server-relative URI by including the context path. </li> - + </ul> - - <p>The <i>forward</i> tag is responsible for either redirecting or forwarding + + <p>The <i>forward</i> tag is responsible for either redirecting or forwarding to a specified global action forward. To define a global ActionForward, see The <a href="../../../../../../userGuide/building_controller.html#config"> Action Mappings Configuration File</a> . You can specify whether the forward re-directs or forwards when executed in the config file. The forward tag has one attribute:</p> - + <ul> <li>name - The logical name of the ActionForward to use</li> - + </ul> - + <p><b>Collection Utilities</b> (iterate)</p> - + <p>The <i>iterate</i> tag is responsible for executing its body content once for every element inside of the specified Collection. There is one required attribute:</p> - + <ul> <li>id - The name of a page scope JSP bean that will contain the current element of the collection on each iteration</li> - + </ul> - + <p>The other attributes allow for more flexibility on which Collection to iterate and how to do it:</p> - + <ul> <li>collection - a runtime expression that evaluates to a Collection -to be iterated +to be iterated <ul> - <li>example: + <li>example: <pre><%<br> java.util.Vector vector = new java.util.Vector();<br> vector.add(new Integer(12));<br> vector.add(new Integer(5));<br> %><br></pre> </li> - + </ul> </li> - + </ul> - - <blockquote> - <blockquote> + + <blockquote> + <blockquote> <pre><logic:iterate id="myCollectionElement" collection="<%= vector %>"><br><i> Do something with myCollectionElement</i> </logic:iterate> </pre> </blockquote> </blockquote> - + <ul> - <li>length - The maximum number of entries (from the underlying collection) + <li>length - 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 java.lang.Integer that defines the desired value. @@ -261,10 +261,10 @@ performed</li> <li>name - The name of the JSP bean containing the collection to be iterated (if property is not specified), or the JSP bean whose property -getter returns the collection to be iterated (if property is specified). - +getter returns the collection to be iterated (if property is specified). + <ul> - <li>example: + <li>example: <pre><%<br> java.util.ArrayList list = new java.util.ArrayList(); list.add("First"); @@ -279,7 +279,7 @@ <i>Do something with myCollectionElement</i> </logic:iterate></pre> </li> - + </ul> </li> <li>offset - The zero-relative index of the starting point at which @@ -299,30 +299,30 @@ through the JSP bean named from the id attribute. If not present, no type conversions will be performed. NOTE: The actual elements of the collection must be assignment-compatible with this class, or a request -time ClassCastException will occur. +time ClassCastException will occur. <ul> - <li>example: + <li>example: <pre><% java.util.ArrayList list = new java.util.ArrayList();<br>list.add("First");<br>list.add("Second");<br>list.add("Third");<br>list.add("Fourth");<br>list.add("Fifth");<br> pageContext.setAttribute("list", list, PageContext.PAGE_SCOPE);<br> %><br><br><logic:iterate id="myCollectionElement" name="list" type="java.lang.String"><br> <i>Do something with myCollectionElement</i> </logic:iterate></pre> </li> - + </ul> </li> - + </ul> </blockquote> - - <h3>Logic Examples</h3> - - <blockquote> + + <h3>Logic Examples<a name="doc.Examples"></a></h3> + + <blockquote> <p><b>Value Comparisons</b></p> - - <blockquote> - <p><u></u><u></u><u>Logic Equivalence Tags (equal, notEqual, greaterEqual, + + <blockquote> + <p><u></u><u></u><u>Logic Equivalence Tags (equal, notEqual, greaterEqual, lessEqual, lessThan, greaterThan)</u></p> - - <blockquote> - <p>You can compare these tags to the "==", "!=" ,">=", + + <blockquote> + <p>You can compare these tags to the "==", "!=" ,">=", "<=", "<", and ">"logic operators in most languages. Their usage is fairly straightforward for numbers. For an example, we'll create a small "Guess That Number" game that uses request parameters @@ -331,47 +331,47 @@ logic inside of jsp pages, and isn't the recommended development method for Struts. It's just an easy way to show how these tags are used:</p> - + <p>The first step is to develop the form that will call on the processing jsp page. This form will use the "GET" method so that you can see the request parameter in the URL. The POST method can also be used with no problem or changes.</p> - + <p>[numberGuess.jsp]</p> - + <pre><form action="numberProcess.jsp" method="GET"><br>Please Enter a Number From 1-10: <input type="text" name="number" /><br /><br> <center><br> <input type="submit" name="Guess Number" /><br> </center><br></form><br></pre> - The next step is to create the processing page. It uses the struts-logic - taglib. For information on how to set this tag library up in your application - to use, see <a href="../../../../../../userGuide/building_controller.html#dd_config"> + The next step is to create the processing page. It uses the struts-logic + taglib. For information on how to set this tag library up in your application + to use, see <a href="../../../../../../userGuide/configuration.html#dd_config"> The Web Application Deployment Descriptor</a> - + <p>[numberProcess.jsp]</p> - + <pre><%@ page language="java" %><br><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %><br></pre> - + <pre><!-- Is the number guess right? --><br><logic:equal parameter="number" value="7"><br> You guessed right! You win a high speed blender!<br></logic:equal><br></pre> - + <pre><!-- If the number guessed was wrong --><br><logic:notEqual parameter="number" value="7"><br> <!-- Less Than --><br> <logic:lessThan parameter="number" value="7"><br> A little higher...<br> </logic:lessThan><br> <!-- Greater Than --><br> <logic:greaterThan parameter="number" value="7"><br> A little lower...<br> </logic:greaterThan><br></logic:notEqual><br></pre> - + <p>Basically, the numberProcess.jsp page uses the equal tag to check if the guess is 7, and if so, prints out a congratulatory message. -If the number isn't equal, specified by the use of the <logic:notEqual> - tag, it uses the greaterThan and lessThan tags to check if the number +If the number isn't equal, specified by the use of the <logic:notEqual> + tag, it uses the greaterThan and lessThan tags to check if the number is higher or lower than 7, and prints out a hint. As said before, this is a horribly designed small application, with no validity checks on the number input, but shows the basic usage of the logic equal tags</p> - - <p>For String comparisons, the equal tags use the java.lang.String.compareTo() - method. See the javadocs on the compareTo() method for more information, + + <p>For String comparisons, the equal tags use the java.lang.String.compareTo() + method. See the javadocs on the compareTo() method for more information, located <a href="http://www.javasoft.com/products/jdk/1.2/docs/api/java/lang/String.html#compareTo%28java.lang.Object%29"> here</a> .</p> </blockquote> - + <p><u>Match and Present Tags (match, notMatch, present, notPresent)</u></p> - - <blockquote> + + <blockquote> <p>You use the match tags in conjunction with the present tags in order to do substring matches. For an example using this we'll use headers, specifically the "Referer" header. The HTTP referer @@ -381,32 +381,32 @@ search, and offer a personalized greeting, frightening users that find our site through the search engine with our amazing intimate knowledge of their browsing habits:</p> - + <p>[sneaky.jsp]</p> - + <pre><%@ page language="java" %><br><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %><br><br><br><!-- Check to see if the "Referer" header is present --><br><logic:present header="Referer"><br> <logic:match header="Referer" value="google.com"><br> I see you found our site through Google... interesting.<br> </logic:match><br> <logic:notMatch header="Referer" value="google.com"><br> Welcome to the site, we're secretly logging what site you came from,<br> because we're shady...<br> </logic:notMatch><br></logic:present><br><br><!-- If the header is not present --><br><logic:notPresent header="Referer"><br> Hi, welcome to our site. Please fill out our<br> <a href="nonExistantForm.jsp">Form</a> and<br> tell us where you're coming from.<br></logic:notPresent></pre> - + <p>Note: Another interesting usage of these tags and headers would be to use the "User-Agent" header to display browser-specific javascript.</p> </blockquote> </blockquote> - + <p><b>Collection Utilities (iterate)</b></p> - - <blockquote> + + <blockquote> <p>For an example of using the <logic:iterate> tag, we'll use one of the previous examples given, in it's entirety. This example uses the <bean:write> tag from the Bean Tag Library, see the User's Guide on the bean tag library for more information on it's usage:</p> - + <p>[iterate.jsp]</p> - + <pre><%@ page language="java" %><br><%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %><br><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %><br></pre> - + <pre><%<br>java.util.ArrayList list = new java.util.ArrayList();<br> list.add("First");<br> list.add("Second");<br> list.add("Third");<br> list.add("Fourth");<br> list.add("Fifth");<br> pageContext.setAttribute("list", list, PageContext.PAGE_SCOPE);<br>%><br><br><logic:iterate id="myCollectionElement" name="list"><br> Element Value: <bean:write name="myCollectionElement" /><br /><br></logic:iterate></pre> </blockquote> </blockquote> - + </body> 1.10 +2 -1 jakarta-struts/src/share/org/apache/struts/tiles/package.html Index: package.html =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/tiles/package.html,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- package.html 14 Jun 2003 06:20:56 -0000 1.9 +++ package.html 26 Jul 2003 06:09:33 -0000 1.10 @@ -43,6 +43,7 @@ <p>This example inserts the specified page in place of the tag. The page attribute is any valid URL pointing to a resource inside the current site.</p> </div> <div class="subsection1"> +<a name="doc.InsertPageWithAttributes"> <h3>Insert a Tiles passing some attributes</h3> <pre> <tiles:insert page="/layouts/classicLayout.jsp" flush="true"> @@ -108,7 +109,7 @@ </html> </pre> <p>The layout is declared in a JSP page (ex: /layouts/classicLayout.jsp). - It can be used in conjunction with the tag described in "<a href="#_Insert_a_page_passing some attribut">Insert + It can be used in conjunction with the tag described in "<a href="#doc.InsertPageWithAttributes">Insert a page passing some attributes</a>". </p> </div> </div>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]