rleland     01/03/06 20:50:54

  Added:       web/exercise-taglib logic-present.jsp logic-match.jsp
                        logic-iterate.jsp logic-compare.jsp index.jsp
                        html-setters.jsp html-select.jsp html-multibox.jsp
                        bean-write.jsp bean-size.jsp bean-resource.jsp
                        bean-parameter.jsp bean-include.jsp bean-header.jsp
                        bean-define.jsp bean-cookie.jsp
  Log:
  Rename test jsp pages to exercises-taglib
  
  Revision  Changes    Path
  1.1                  jakarta-struts/web/exercise-taglib/logic-present.jsp
  
  Index: logic-present.jsp
  ===================================================================
  <%@ page language="java" %>
  <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
  <html>
  <head>
  <title>Test struts-logic Presence Tags</title>
  </head>
  <body bgcolor="white">
  
  <div align="center">
  <h1>Test struts-logic Presence Tags</h1>
  </div>
  
  <jsp:useBean id="bean" scope="page" 
class="org.apache.struts.exercise-taglib.TestBean"/>
  
  <table border="1">
    <tr>
      <th>Test Type</th>
      <th>Correct Value</th>
      <th>Test Result</th>
    </tr>
    <tr>
      <td>Bean</td>
      <td>present</td>
      <td>
        <logic:present name="bean">
          present
        </logic:present>
        <logic:notPresent name="bean">
          notPresent
        </logic:notPresent>
      </td>
    </tr>
    <tr>
      <td>Bean</td>
      <td>notPresent</td>
      <td>
        <logic:present name="FOOBAR">
          present
        </logic:present>
        <logic:notPresent name="FOOBAR">
          notPresent
        </logic:notPresent>
      </td>
    </tr>
    <tr>
      <td>Cookie</td>
  <% if (request.isRequestedSessionIdFromCookie()) { %>
      <td>present</td>
  <% } else { %>
      <td>notPresent</td>
  <% } %>
      <td>
        <logic:present cookie="JSESSIONID">
          present
        </logic:present>
        <logic:notPresent cookie="JSESSIONID">
          notPresent
        </logic:notPresent>
      </td>
    </tr>
    <tr>
      <td>Cookie</td>
      <td>notPresent</td>
      <td>
        <logic:present cookie="FOOBAR">
          present
        </logic:present>
        <logic:notPresent cookie="FOOBAR">
          notPresent
        </logic:notPresent>
      </td>
    </tr>
    <tr>
      <td>Header</td>
      <td>present</td>
      <td>
        <logic:present header="User-Agent">
          present
        </logic:present>
        <logic:notPresent header="User-Agent">
          notPresent
        </logic:notPresent>
      </td>
    </tr>
    <tr>
      <td>Header</td>
      <td>notPresent</td>
      <td>
        <logic:present header="FOOBAR">
          present
        </logic:present>
        <logic:notPresent header="FOOBAR">
          notPresent
        </logic:notPresent>
      </td>
    </tr>
    <tr>
      <td>Parameter</td>
      <td>present</td>
      <td>
        <logic:present parameter="param1">
          present
        </logic:present>
        <logic:notPresent parameter="param1">
          notPresent
        </logic:notPresent>
      </td>
    </tr>
    <tr>
      <td>Parameter</td>
      <td>notPresent</td>
      <td>
        <logic:present parameter="FOOBAR">
          present
        </logic:present>
        <logic:notPresent parameter="FOOBAR">
          notPresent
        </logic:notPresent>
      </td>
    </tr>
    <tr>
      <td>Property</td>
      <td>present</td>
      <td>
        <logic:present name="bean" property="stringProperty">
          present
        </logic:present>
        <logic:notPresent name="bean" property="stringProperty">
          notPresent
        </logic:notPresent>
      </td>
    </tr>
    <tr>
      <td>Property</td>
      <td>notPresent</td>
      <td>
        <logic:present name="bean" property="nullProperty">
          present
        </logic:present>
        <logic:notPresent name="bean" property="nullProperty">
          notPresent
        </logic:notPresent>
      </td>
    </tr>
  </table>
  
  </body>
  </html>
  
  
  
  1.1                  jakarta-struts/web/exercise-taglib/logic-match.jsp
  
  Index: logic-match.jsp
  ===================================================================
  <%@ page language="java" %>
  <%@ taglib uri="/WEB-INF/struts-bean.tld"  prefix="bean"  %>
  <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
  <html>
  <head>
  <title>Test struts-logic Match Tags</title>
  </head>
  <body bgcolor="white">
  
  <div align="center">
  <h1>Test struts-logic Match Tags</h1>
  </div>
  
  <jsp:useBean id="bean" scope="page" 
class="org.apache.struts.exercise-taglib.TestBean"/>
  <bean:cookie    id="cookie" name="JSESSIONID" value="JSESSIONID-IS-UNDEFINED"/>
  <bean:header    id="header" name="User-Agent" value="USER-AGENT-IS-UNDEFINED"/>
  <bean:parameter id="param"  name="param1"/>
  <%
    pageContext.setAttribute("string", "String test value");
  %>
  
  <table border="1">
    <tr>
      <th>Test Type</th>
      <th>Variable Content</th>
      <th>Value Content</th>
      <th>Correct Value Test</th>
      <th>Test Result</th>
    </tr>
    <tr>
      <td>Cookie / Any</td>
      <td><bean:write name="cookie" property="value"/></td>
      <td>0</td>
      <td>contains</td>
      <td>
        <logic:match cookie="JSESSIONID" value="0">
          match
        </logic:match>
        <logic:notMatch cookie="JSESSIONID" value="0">
          notMatch
        </logic:notMatch>
      </td>
    </tr>
    <tr>
      <td>Cookie / End</td>
      <td><bean:write name="cookie" property="value"/></td>
      <td>0</td>
      <td>ends with</td>
      <td>
        <logic:match cookie="JSESSIONID" location="end" value="0">
          match
        </logic:match>
        <logic:notMatch cookie="JSESSIONID" location="end" value="0">
          notMatch
        </logic:notMatch>
      </td>
    </tr>
    <tr>
      <td>Cookie / Start</td>
      <td><bean:write name="cookie" property="value"/></td>
      <td>0</td>
      <td>starts with</td>
      <td>
        <logic:match cookie="JSESSIONID" location="start" value="0">
          match
        </logic:match>
        <logic:notMatch cookie="JSESSIONID" location="start" value="0">
          notMatch
        </logic:notMatch>
      </td>
    </tr>
    <tr>
      <td>Header / Any</td>
      <td><bean:write name="header"/></td>
      <td>Mozilla</td>
      <td>contains</td>
      <td>
        <logic:match header="User-Agent" value="Mozilla">
          match
        </logic:match>
        <logic:notMatch header="User-Agent" value="Mozilla">
          notMatch
        </logic:notMatch>
      </td>
    </tr>
    <tr>
      <td>Header / End</td>
      <td><bean:write name="header"/></td>
      <td>Mozilla</td>
      <td>ends with</td>
      <td>
        <logic:match header="User-Agent" location="end" value="Mozilla">
          match
        </logic:match>
        <logic:notMatch header="User-Agent" location="end" value="Mozilla">
          notMatch
        </logic:notMatch>
      </td>
    </tr>
    <tr>
      <td>Header / Start</td>
      <td><bean:write name="header"/></td>
      <td>Mozilla</td>
      <td>starts with</td>
      <td>
        <logic:match header="user-agent" location="start" value="Mozilla">
          match
        </logic:match>
        <logic:notMatch header="user-agent" location="start" value="Mozilla">
          notMatch
        </logic:notMatch>
      </td>
    </tr>
    <tr>
      <td>Name / Any</td>
      <td><bean:write name="string"/></td>
      <td>value</td>
      <td>contains</td>
      <td>
        <logic:match name="string" value="value">
          match
        </logic:match>
        <logic:notMatch name="string" value="value">
          notMatch
        </logic:notMatch>
      </td>
    </tr>
    <tr>
      <td>Name / End</td>
      <td><bean:write name="string"/></td>
      <td>value</td>
      <td>ends with</td>
      <td>
        <logic:match name="string" location="end" value="value">
          match
        </logic:match>
        <logic:notMatch name="string" location="end" value="value">
          notMatch
        </logic:notMatch>
      </td>
    </tr>
    <tr>
      <td>Name / Start</td>
      <td><bean:write name="string"/></td>
      <td>value</td>
      <td>starts with</td>
      <td>
        <logic:match name="string" location="start" value="value">
          match
        </logic:match>
        <logic:notMatch name="string" location="start" value="value">
          notMatch
        </logic:notMatch>
      </td>
    </tr>
    <tr>
      <td>Parameter / Any</td>
      <td><bean:write name="param"/></td>
      <td>value1</td>
      <td>contains</td>
      <td>
        <logic:match parameter="param1" value="value1">
          match
        </logic:match>
        <logic:notMatch parameter="param1" value="value1">
          notMatch
        </logic:notMatch>
      </td>
    </tr>
    <tr>
      <td>Parameter / End</td>
      <td><bean:write name="param"/></td>
      <td>value1</td>
      <td>ends with</td>
      <td>
        <logic:match parameter="param1" location="end" value="value1">
          match
        </logic:match>
        <logic:notMatch parameter="param1" location="end" value="value1">
          notMatch
        </logic:notMatch>
      </td>
    </tr>
    <tr>
      <td>Parameter / Start</td>
      <td><bean:write name="param"/></td>
      <td>value1</td>
      <td>starts with</td>
      <td>
        <logic:match parameter="param1" location="start" value="value1">
          match
        </logic:match>
        <logic:notMatch parameter="param1" location="start" value="value1">
          notMatch
        </logic:notMatch>
      </td>
    </tr>
    <tr>
      <td>Property / Any</td>
      <td><bean:write name="bean" property="stringProperty"/></td>
      <td>FOO</td>
      <td>contains</td>
      <td>
        <logic:match name="bean" property="stringProperty" value="FOO">
          match
        </logic:match>
        <logic:notMatch name="bean" property="stringProperty" value="FOO">
          notMatch
        </logic:notMatch>
      </td>
    </tr>
    <tr>
      <td>Property / End</td>
      <td><bean:write name="bean" property="stringProperty"/></td>
      <td>FOO</td>
      <td>ends with</td>
      <td>
        <logic:match name="bean" property="stringProperty"
               location="end" value="FOO">
          match
        </logic:match>
        <logic:notMatch name="bean" property="stringProperty"
               location="end" value="FOO">
          notMatch
        </logic:notMatch>
      </td>
    </tr>
    <tr>
      <td>Property / Start</td>
      <td><bean:write name="bean" property="stringProperty"/></td>
      <td>FOO</td>
      <td>starts with</td>
      <td>
        <logic:match name="bean" property="stringProperty"
               location="start" value="FOO">
          match
        </logic:match>
        <logic:notMatch name="bean" property="stringProperty"
               location="start" value="FOO">
          notMatch
        </logic:notMatch>
      </td>
    </tr>
  </table>
  
  </body>
  </html>
  
  
  
  1.1                  jakarta-struts/web/exercise-taglib/logic-iterate.jsp
  
  Index: logic-iterate.jsp
  ===================================================================
  <%@ page language="java" %>
  <%@ taglib uri="/WEB-INF/struts-bean.tld"  prefix="bean" %>
  <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
  <html>
  <head>
  <title>Test struts-logic Iterate Tag</title>
  </head>
  <body bgcolor="white">
  
  <%
    {
      java.util.ArrayList list = new java.util.ArrayList();
      list.add("First");
      list.add("Second");
      list.add("Third");
      list.add("Fourth");
      list.add("Fifth");
      pageContext.setAttribute("list", list, PageContext.PAGE_SCOPE);
    }
  %>
  
  <div align="center">
  <h1>Test struts-logic Iterate Tag</h1>
  </div>
  
  <jsp:useBean id="bean" scope="page" 
class="org.apache.struts.exercise-taglib.TestBean"/>
  <jsp:useBean id="list" scope="page" class="java.util.ArrayList"/>
  
  <h3>Test 1 - Iterate Over A String Array [0..4]</h3>
  
  <ol>
  <logic:iterate id="element" name="bean" property="stringArray">
    <li><em><bean:write name="element"/></em></li>
  </logic:iterate>
  </ol>
  
  <h3>Test 2 - Iterate Over A String Array [0..2]</h3>
  
  <ol>
  <logic:iterate id="element" name="bean" property="stringArray" length="3">
    <li><em><bean:write name="element"/></em></li>
  </logic:iterate>
  </ol>
  
  <h3>Test 3 - Iterate Over A String Array [3..4]</h3>
  
  <ol>
  <logic:iterate id="element" name="bean" property="stringArray" offset="3">
    <li><em><bean:write name="element"/></em></li>
  </logic:iterate>
  </ol>
  
  <h3>Test 4 - Iterate Over A String Array [1..3]</h3>
  
  <ol>
  <logic:iterate id="element" name="bean" property="stringArray"
                 offset="1" length="3">
    <li><em><bean:write name="element"/></em></li>
  </logic:iterate>
  </ol>
  
  <h3>Test 5 - Iterate Over an Array List</h3>
  
  <ol>
  <logic:iterate id="item" name="list">
    <li><em><bean:write name="item"/></em></li>
  </logic:iterate>
  </ol>
  
  <h3>Test 6 - Iterate Over an Array List [0..2]</h3>
  
  <ol>
  <logic:iterate id="item" name="list"
         offset="0" length="3">
    <li><em><bean:write name="item"/></em></li>
  </logic:iterate>
  </ol>
  
  <h3>Test 7 - Iterate Over an Array List [2..4]</h3>
  
  <ol>
  <logic:iterate id="item" name="list"
         offset="2" length="3">
    <li><em><bean:write name="item"/></em></li>
  </logic:iterate>
  </ol>
  
  </body>
  </html>
  
  
  
  1.1                  jakarta-struts/web/exercise-taglib/logic-compare.jsp
  
  Index: logic-compare.jsp
  ===================================================================
  <%@ page language="java" %>
  <%@ taglib uri="/WEB-INF/struts-bean.tld"  prefix="bean" %>
  <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
  <html>
  <head>
  <title>Test struts-logic Comparison Tags</title>
  </head>
  <body bgcolor="white">
  
  <div align="center">
  <h1>Test struts-logic Comparison Tags</h1>
  </div>
  
  <jsp:useBean id="bean" scope="page" 
class="org.apache.struts.exercise-taglib.TestBean"/>
  <%
    String doub1 = "321.0";
    String doub2 = "111.0";
    String doub3 = "333.0";
    String long1 = "321";
    String long2 = "111";
    String long3 = "333";
    String short1 = "987";
    String short2 = "654";
    String short3 = "999";
    String str1 = "This is a string";
    String str2 = "Less than";
    String str3 = "XYZ greater than";
  %>
  
  <table border="1">
    <tr>
      <th>Test Type</th>
      <th>Variable Content</th>
      <th>Value Content </th>
      <th>Correct Value</th>
      <th>Test Result</th>
    </tr>
    <tr>
      <td>double / EQ</td>
      <td><bean:write name="bean" property="doubleProperty"/></td>
      <td><%= doub1 %></td>
      <td>equal greaterEqual lessEqual</td>
      <td>
        <logic:equal name="bean" property="doubleProperty"
               value="<%= doub1 %>">
          equal
        </logic:equal>
        <logic:greaterEqual name="bean" property="doubleProperty"
               value="<%= doub1 %>">
          greaterEqual
        </logic:greaterEqual>
        <logic:greaterThan name="bean" property="doubleProperty"
               value="<%= doub1 %>">
          greaterThan
        </logic:greaterThan>
        <logic:lessEqual name="bean" property="doubleProperty"
               value="<%= doub1 %>">
          lessEqual
        </logic:lessEqual>
        <logic:lessThan name="bean" property="doubleProperty"
               value="<%= doub1 %>">
          lessThan
        </logic:lessThan>
        <logic:notEqual name="bean" property="doubleProperty"
               value="<%= doub1 %>">
          notEqual
        </logic:notEqual>
      </td>
    </tr>
    <tr>
      <td>double / GT</td>
      <td><bean:write name="bean" property="doubleProperty"/></td>
      <td><%= doub2 %></td>
      <td>greaterEqual greaterThan notEqual</td>
      <td>
        <logic:equal name="bean" property="doubleProperty"
               value="<%= doub2 %>">
          equal
        </logic:equal>
        <logic:greaterEqual name="bean" property="doubleProperty"
               value="<%= doub2 %>">
          greaterEqual
        </logic:greaterEqual>
        <logic:greaterThan name="bean" property="doubleProperty"
               value="<%= doub2 %>">
          greaterThan
        </logic:greaterThan>
        <logic:lessEqual name="bean" property="doubleProperty"
               value="<%= doub2 %>">
          lessEqual
        </logic:lessEqual>
        <logic:lessThan name="bean" property="doubleProperty"
               value="<%= doub2 %>">
          lessThan
        </logic:lessThan>
        <logic:notEqual name="bean" property="doubleProperty"
               value="<%= doub2 %>">
          notEqual
        </logic:notEqual>
      </td>
    </tr>
    <tr>
      <td>double / LT</td>
      <td><bean:write name="bean" property="doubleProperty"/></td>
      <td><%= doub3 %></td>
      <td>lessEqual lessThan notEqual</td>
      <td>
        <logic:equal name="bean" property="doubleProperty"
               value="<%= doub3 %>">
          equal
        </logic:equal>
        <logic:greaterEqual name="bean" property="doubleProperty"
               value="<%= doub3 %>">
          greaterEqual
        </logic:greaterEqual>
        <logic:greaterThan name="bean" property="doubleProperty"
               value="<%= doub3 %>">
          greaterThan
        </logic:greaterThan>
        <logic:lessEqual name="bean" property="doubleProperty"
               value="<%= doub3 %>">
          lessEqual
        </logic:lessEqual>
        <logic:lessThan name="bean" property="doubleProperty"
               value="<%= doub3 %>">
          lessThan
        </logic:lessThan>
        <logic:notEqual name="bean" property="doubleProperty"
               value="<%= doub3 %>">
          notEqual
        </logic:notEqual>
      </td>
    </tr>
    <tr>
      <td>float / EQ</td>
      <td><bean:write name="bean" property="floatProperty"/></td>
      <td><%= doub1 %></td>
      <td>lessEqual lessThan notEqual</td>
      <td>
        <logic:equal name="bean" property="floatProperty"
               value="<%= doub1 %>">
          equal
        </logic:equal>
        <logic:greaterEqual name="bean" property="floatProperty"
               value="<%= doub1 %>">
          greaterEqual
        </logic:greaterEqual>
        <logic:greaterThan name="bean" property="floatProperty"
               value="<%= doub1 %>">
          greaterThan
        </logic:greaterThan>
        <logic:lessEqual name="bean" property="floatProperty"
               value="<%= doub1 %>">
          lessEqual
        </logic:lessEqual>
        <logic:lessThan name="bean" property="floatProperty"
               value="<%= doub1 %>">
          lessThan
        </logic:lessThan>
        <logic:notEqual name="bean" property="floatProperty"
               value="<%= doub1 %>">
          notEqual
        </logic:notEqual>
      </td>
    </tr>
    <tr>
      <td>float / GT</td>
      <td><bean:write name="bean" property="floatProperty"/></td>
      <td><%= doub2 %></td>
      <td>greaterEqual greaterThan notEqual</td>
      <td>
        <logic:equal name="bean" property="floatProperty"
               value="<%= doub2 %>">
          equal
        </logic:equal>
        <logic:greaterEqual name="bean" property="floatProperty"
               value="<%= doub2 %>">
          greaterEqual
        </logic:greaterEqual>
        <logic:greaterThan name="bean" property="floatProperty"
               value="<%= doub2 %>">
          greaterThan
        </logic:greaterThan>
        <logic:lessEqual name="bean" property="floatProperty"
               value="<%= doub2 %>">
          lessEqual
        </logic:lessEqual>
        <logic:lessThan name="bean" property="floatProperty"
               value="<%= doub2 %>">
          lessThan
        </logic:lessThan>
        <logic:notEqual name="bean" property="floatProperty"
               value="<%= doub2 %>">
          notEqual
        </logic:notEqual>
      </td>
    </tr>
    <tr>
      <td>float / LT</td>
      <td><bean:write name="bean" property="floatProperty"/></td>
      <td><%= doub3 %></td>
      <td>lessEqual lessThan notEqual</td>
      <td>
        <logic:equal name="bean" property="floatProperty"
               value="<%= doub3 %>">
          equal
        </logic:equal>
        <logic:greaterEqual name="bean" property="floatProperty"
               value="<%= doub3 %>">
          greaterEqual
        </logic:greaterEqual>
        <logic:greaterThan name="bean" property="floatProperty"
               value="<%= doub3 %>">
          greaterThan
        </logic:greaterThan>
        <logic:lessEqual name="bean" property="floatProperty"
               value="<%= doub3 %>">
          lessEqual
        </logic:lessEqual>
        <logic:lessThan name="bean" property="floatProperty"
               value="<%= doub3 %>">
          lessThan
        </logic:lessThan>
        <logic:notEqual name="bean" property="floatProperty"
               value="<%= doub3 %>">
          notEqual
        </logic:notEqual>
      </td>
    </tr>
    <tr>
      <td>int / EQ</td>
      <td><bean:write name="bean" property="intProperty"/></td>
      <td><%= long1 %></td>
      <td>lessEqual lessThan notEqual</td>
      <td>
        <logic:equal name="bean" property="intProperty"
               value="<%= long1 %>">
          equal
        </logic:equal>
        <logic:greaterEqual name="bean" property="intProperty"
               value="<%= long1 %>">
          greaterEqual
        </logic:greaterEqual>
        <logic:greaterThan name="bean" property="intProperty"
               value="<%= long1 %>">
          greaterThan
        </logic:greaterThan>
        <logic:lessEqual name="bean" property="intProperty"
               value="<%= long1 %>">
          lessEqual
        </logic:lessEqual>
        <logic:lessThan name="bean" property="intProperty"
               value="<%= long1 %>">
          lessThan
        </logic:lessThan>
        <logic:notEqual name="bean" property="intProperty"
               value="<%= long1 %>">
          notEqual
        </logic:notEqual>
      </td>
    </tr>
    <tr>
      <td>int / GT</td>
      <td><bean:write name="bean" property="intProperty"/></td>
      <td><%= long2 %></td>
      <td>greaterEqual greaterThan notEqual</td>
      <td>
        <logic:equal name="bean" property="intProperty"
               value="<%= long2 %>">
          equal
        </logic:equal>
        <logic:greaterEqual name="bean" property="intProperty"
               value="<%= long2 %>">
          greaterEqual
        </logic:greaterEqual>
        <logic:greaterThan name="bean" property="intProperty"
               value="<%= long2 %>">
          greaterThan
        </logic:greaterThan>
        <logic:lessEqual name="bean" property="intProperty"
               value="<%= long2 %>">
          lessEqual
        </logic:lessEqual>
        <logic:lessThan name="bean" property="intProperty"
               value="<%= long2 %>">
          lessThan
        </logic:lessThan>
        <logic:notEqual name="bean" property="intProperty"
               value="<%= long2 %>">
          notEqual
        </logic:notEqual>
      </td>
    </tr>
    <tr>
      <td>int / LT</td>
      <td><bean:write name="bean" property="intProperty"/></td>
      <td><%= long3 %></td>
      <td>lessEqual lessThan notEqual</td>
      <td>
        <logic:equal name="bean" property="intProperty"
               value="<%= long3 %>">
          equal
        </logic:equal>
        <logic:greaterEqual name="bean" property="intProperty"
               value="<%= long3 %>">
          greaterEqual
        </logic:greaterEqual>
        <logic:greaterThan name="bean" property="intProperty"
               value="<%= long3 %>">
          greaterThan
        </logic:greaterThan>
        <logic:lessEqual name="bean" property="intProperty"
               value="<%= long3 %>">
          lessEqual
        </logic:lessEqual>
        <logic:lessThan name="bean" property="intProperty"
               value="<%= long3 %>">
          lessThan
        </logic:lessThan>
        <logic:notEqual name="bean" property="intProperty"
               value="<%= long3 %>">
          notEqual
        </logic:notEqual>
      </td>
    </tr>
    <tr>
      <td>string / EQ</td>
      <td><bean:write name="bean" property="stringProperty"/></td>
      <td><%= str1 %></td>
      <td>equal greaterEqual lessEqual</td>
      <td>
        <logic:equal name="bean" property="stringProperty"
               value="<%= str1 %>">
          equal
        </logic:equal>
        <logic:greaterEqual name="bean" property="stringProperty"
               value="<%= str1 %>">
          greaterEqual
        </logic:greaterEqual>
        <logic:greaterThan name="bean" property="stringProperty"
               value="<%= str1 %>">
          greaterThan
        </logic:greaterThan>
        <logic:lessEqual name="bean" property="stringProperty"
               value="<%= str1 %>">
          lessEqual
        </logic:lessEqual>
        <logic:lessThan name="bean" property="stringProperty"
               value="<%= str1 %>">
          lessThan
        </logic:lessThan>
        <logic:notEqual name="bean" property="stringProperty"
               value="<%= str1 %>">
          notEqual
        </logic:notEqual>
      </td>
    </tr>
    <tr>
      <td>long / EQ</td>
      <td><bean:write name="bean" property="longProperty"/></td>
      <td><%= long1 %></td>
      <td>equal greaterEqual lessEqual</td>
      <td>
        <logic:equal name="bean" property="longProperty"
               value="<%= long1 %>">
          equal
        </logic:equal>
        <logic:greaterEqual name="bean" property="longProperty"
               value="<%= long1 %>">
          greaterEqual
        </logic:greaterEqual>
        <logic:greaterThan name="bean" property="longProperty"
               value="<%= long1 %>">
          greaterThan
        </logic:greaterThan>
        <logic:lessEqual name="bean" property="longProperty"
               value="<%= long1 %>">
          lessEqual
        </logic:lessEqual>
        <logic:lessThan name="bean" property="longProperty"
               value="<%= long1 %>">
          lessThan
        </logic:lessThan>
        <logic:notEqual name="bean" property="longProperty"
               value="<%= long1 %>">
          notEqual
        </logic:notEqual>
      </td>
    </tr>
    <tr>
      <td>long / GT</td>
      <td><bean:write name="bean" property="longProperty"/></td>
      <td><%= long2 %></td>
      <td>greaterEqual greaterThan notEqual</td>
      <td>
        <logic:equal name="bean" property="longProperty"
               value="<%= long2 %>">
          equal
        </logic:equal>
        <logic:greaterEqual name="bean" property="longProperty"
               value="<%= long2 %>">
          greaterEqual
        </logic:greaterEqual>
        <logic:greaterThan name="bean" property="longProperty"
               value="<%= long2 %>">
          greaterThan
        </logic:greaterThan>
        <logic:lessEqual name="bean" property="longProperty"
               value="<%= long2 %>">
          lessEqual
        </logic:lessEqual>
        <logic:lessThan name="bean" property="longProperty"
               value="<%= long2 %>">
          lessThan
        </logic:lessThan>
        <logic:notEqual name="bean" property="longProperty"
               value="<%= long2 %>">
          notEqual
        </logic:notEqual>
      </td>
    </tr>
    <tr>
      <td>long / LT</td>
      <td><bean:write name="bean" property="longProperty"/></td>
      <td><%= long3 %></td>
      <td>lessEqual lessThan notEqual</td>
      <td>
        <logic:equal name="bean" property="longProperty"
               value="<%= long3 %>">
          equal
        </logic:equal>
        <logic:greaterEqual name="bean" property="longProperty"
               value="<%= long3 %>">
          greaterEqual
        </logic:greaterEqual>
        <logic:greaterThan name="bean" property="longProperty"
               value="<%= long3 %>">
          greaterThan
        </logic:greaterThan>
        <logic:lessEqual name="bean" property="longProperty"
               value="<%= long3 %>">
          lessEqual
        </logic:lessEqual>
        <logic:lessThan name="bean" property="longProperty"
               value="<%= long3 %>">
          lessThan
        </logic:lessThan>
        <logic:notEqual name="bean" property="longProperty"
               value="<%= long3 %>">
          notEqual
        </logic:notEqual>
      </td>
    </tr>
    <tr>
      <td>short / EQ</td>
      <td><bean:write name="bean" property="shortProperty"/></td>
      <td><%= short1 %></td>
      <td>equal greaterEqual lessEqual</td>
      <td>
        <logic:equal name="bean" property="shortProperty"
               value="<%= short1 %>">
          equal
        </logic:equal>
        <logic:greaterEqual name="bean" property="shortProperty"
               value="<%= short1 %>">
          greaterEqual
        </logic:greaterEqual>
        <logic:greaterThan name="bean" property="shortProperty"
               value="<%= short1 %>">
          greaterThan
        </logic:greaterThan>
        <logic:lessEqual name="bean" property="shortProperty"
               value="<%= short1 %>">
          lessEqual
        </logic:lessEqual>
        <logic:lessThan name="bean" property="shortProperty"
               value="<%= short1 %>">
          lessThan
        </logic:lessThan>
        <logic:notEqual name="bean" property="shortProperty"
               value="<%= short1 %>">
          notEqual
        </logic:notEqual>
      </td>
    </tr>
    <tr>
      <td>short / GT</td>
      <td><bean:write name="bean" property="shortProperty"/></td>
      <td><%= short2 %></td>
      <td>greaterEqual greaterThan notEqual</td>
      <td>
        <logic:equal name="bean" property="shortProperty"
               value="<%= short2 %>">
          equal
        </logic:equal>
        <logic:greaterEqual name="bean" property="shortProperty"
               value="<%= short2 %>">
          greaterEqual
        </logic:greaterEqual>
        <logic:greaterThan name="bean" property="shortProperty"
               value="<%= short2 %>">
          greaterThan
        </logic:greaterThan>
        <logic:lessEqual name="bean" property="shortProperty"
               value="<%= short2 %>">
          lessEqual
        </logic:lessEqual>
        <logic:lessThan name="bean" property="shortProperty"
               value="<%= short2 %>">
          lessThan
        </logic:lessThan>
        <logic:notEqual name="bean" property="shortProperty"
               value="<%= short2 %>">
          notEqual
        </logic:notEqual>
      </td>
    </tr>
    <tr>
      <td>short / LT</td>
      <td><bean:write name="bean" property="shortProperty"/></td>
      <td><%= short3 %></td>
      <td>lessEqual lessThan notEqual</td>
      <td>
        <logic:equal name="bean" property="shortProperty"
               value="<%= short3 %>">
          equal
        </logic:equal>
        <logic:greaterEqual name="bean" property="shortProperty"
               value="<%= short3 %>">
          greaterEqual
        </logic:greaterEqual>
        <logic:greaterThan name="bean" property="shortProperty"
               value="<%= short3 %>">
          greaterThan
        </logic:greaterThan>
        <logic:lessEqual name="bean" property="shortProperty"
               value="<%= short3 %>">
          lessEqual
        </logic:lessEqual>
        <logic:lessThan name="bean" property="shortProperty"
               value="<%= short3 %>">
          lessThan
        </logic:lessThan>
        <logic:notEqual name="bean" property="shortProperty"
               value="<%= short3 %>">
          notEqual
        </logic:notEqual>
      </td>
    </tr>
    <tr>
      <td>string / GT</td>
      <td><bean:write name="bean" property="stringProperty"/></td>
      <td><%= str2 %></td>
      <td>greaterEqual greaterThan notEqual</td>
      <td>
        <logic:equal name="bean" property="stringProperty"
               value="<%= str2 %>">
          equal
        </logic:equal>
        <logic:greaterEqual name="bean" property="stringProperty"
               value="<%= str2 %>">
          greaterEqual
        </logic:greaterEqual>
        <logic:greaterThan name="bean" property="stringProperty"
               value="<%= str2 %>">
          greaterThan
        </logic:greaterThan>
        <logic:lessEqual name="bean" property="stringProperty"
               value="<%= str2 %>">
          lessEqual
        </logic:lessEqual>
        <logic:lessThan name="bean" property="stringProperty"
               value="<%= str2 %>">
          lessThan
        </logic:lessThan>
        <logic:notEqual name="bean" property="stringProperty"
               value="<%= str2 %>">
          notEqual
        </logic:notEqual>
      </td>
    </tr>
    <tr>
      <td>string / LT</td>
      <td><bean:write name="bean" property="stringProperty"/></td>
      <td><%= str3 %></td>
      <td>lessEqual lessThan notEqual</td>
      <td>
        <logic:equal name="bean" property="stringProperty"
               value="<%= str3 %>">
          equal
        </logic:equal>
        <logic:greaterEqual name="bean" property="stringProperty"
               value="<%= str3 %>">
          greaterEqual
        </logic:greaterEqual>
        <logic:greaterThan name="bean" property="stringProperty"
               value="<%= str3 %>">
          greaterThan
        </logic:greaterThan>
        <logic:lessEqual name="bean" property="stringProperty"
               value="<%= str3 %>">
          lessEqual
        </logic:lessEqual>
        <logic:lessThan name="bean" property="stringProperty"
               value="<%= str3 %>">
          lessThan
        </logic:lessThan>
        <logic:notEqual name="bean" property="stringProperty"
               value="<%= str3 %>">
          notEqual
        </logic:notEqual>
      </td>
    </tr>
  </table>
  
  </body>
  </html>
  
  
  
  1.1                  jakarta-struts/web/exercise-taglib/index.jsp
  
  Index: index.jsp
  ===================================================================
  <html>
  <head>
  <title>Struts Test Application</title>
  </head>
  <body bgcolor="white">
  
  <div align="center">
  <h1>STRUTS Test Pages</h1>
  </div>
  
  <h3>BEAN Tags</h3>
  <ul>
  <li><a href="bean-cookie.jsp">&lt;bean:cookie&gt;</a></li>
  <li><a href="bean-define.jsp">&lt;bean:define&gt;</a></li>
  <li><a href="bean-header.jsp">&lt;bean:header&gt;</a></li>
  <li><a href="bean-include.jsp">&lt;bean:include&gt;</a></li>
  <li><a 
href="bean-parameter.jsp?param1=value1&param2=value2">&lt;bean:parameter&gt;</a></li>
  <li><a href="bean-resource.jsp">&lt;bean:resource&gt;</a></li>
  <li><a href="bean-size.jsp">&lt;bean:size&gt;</a></li>
  <li><a href="bean-write.jsp">&lt;bean:write&gt;</a></li>
  </ul>
  
  <h3>HTML Tags</h3>
  <ul>
  <li><a href="html-multibox.jsp">&lt;html:multibox&gt;</a></li>
  <li><a href="html-select.jsp">&lt;html:select&gt;</a></li>
  <li><a href="html-setters.jsp">Scalar Setters</a></li>
  </ul>
  
  <h3>LOGIC Tags</h3>
  <ul>
  <li><a href="logic-compare.jsp">Comparison Tags</a></li>
  <li><a href="logic-iterate.jsp">Iterate Tag</a></li>
  <li><a href="logic-match.jsp?param1=value1">Match Tags</a></li>
  <li><a href="logic-present.jsp?param1=value1">Presence Tags</a></li>
  </ul>
  
  </body>
  </html>
  
  
  
  1.1                  jakarta-struts/web/exercise-taglib/html-setters.jsp
  
  Index: html-setters.jsp
  ===================================================================
  <%@ page language="java"%>
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
  <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
  <html:html>
  <head>
  <title>Test struts-html Property Setters</title>
  </head>
  <body bgcolor="white">
  
  <div align="center">
  <h1>Test struts-html Property Setters</h1>
  </div>
  
  Whatever changes you make to properties should be reflected when the page
  is redisplayed.  Press "Save" to update, or "Cancel" to return to the
  main menu.
  
  <html:form action="html-setters.do">
  <table border="0" width="100%">
  
    <tr>
      <th align="center" colspan="4">Scalar Properties</th align="center">
    </tr>
  
    <tr>
      <th align="right">booleanProperty</th>
      <td align="left">
        <html:checkbox property="booleanProperty"/>
      </td>
      <th align="right">nested.booleanProperty</th>
      <td align="left">
        <html:checkbox property="nested.booleanProperty"/>
      </td>
    </tr>
  
    <tr>
      <th align="right">doubleProperty</th>
      <td align="left">
        <html:text property="doubleProperty" size="32"/>
      </td>
      <th align="right">nested.doubleProperty</th>
      <td align="left">
        <html:text property="nested.doubleProperty" size="32"/>
      </td>
    </tr>
  
    <tr>
      <th align="right">floatProperty</th>
      <td align="left">
        <html:text property="floatProperty" size="32"/>
      </td>
      <th align="right">nested.floatProperty</th>
      <td align="left">
        <html:text property="nested.floatProperty" size="32"/>
      </td>
    </tr>
  
    <tr>
      <th align="right">intProperty</th>
      <td align="left">
        <html:text property="intProperty" size="32"/>
      </td>
      <th align="right">nested.intProperty</th>
      <td align="left">
        <html:text property="nested.intProperty" size="32"/>
      </td>
    </tr>
  
    <tr>
      <th align="right">longProperty</th>
      <td align="left">
        <html:text property="longProperty" size="32"/>
      </td>
      <th align="right">nested.longProperty</th>
      <td align="left">
        <html:text property="nested.longProperty" size="32"/>
      </td>
    </tr>
  
    <tr>
      <th align="right">stringProperty</th>
      <td align="left">
        <html:text property="stringProperty" size="32"/>
      </td>
      <th align="right">nested.stringProperty</th>
      <td align="left">
        <html:text property="nested.stringProperty" size="32"/>
      </td>
    </tr>
  
    <tr>
      <th align="center" colspan="4">Indexed Properties</th align="center">
    </tr>
  
    <tr>
      <th align="right">intIndexed[0]</th>
      <td align="left">
        <html:text property="intIndexed[0]" size="32"/>
      </td>
      <th align="right">nested.intIndexed[0]</th>
      <td align="left">
        <html:text property="nested.intIndexed[0]" size="32"/>
      </td>
    </tr>
  
    <tr>
      <th align="right">intIndexed[1]</th>
      <td align="left">
        <html:text property="intIndexed[1]" size="32"/>
      </td>
      <th align="right">nested.intIndexed[1]</th>
      <td align="left">
        <html:text property="nested.intIndexed[1]" size="32"/>
      </td>
    </tr>
  
    <tr>
      <th align="right">stringIndexed[0]</th>
      <td align="left">
        <html:text property="stringIndexed[0]" size="32"/>
      </td>
      <th align="right">nested.stringIndexed[0]</th>
      <td align="left">
        <html:text property="nested.stringIndexed[0]" size="32"/>
      </td>
    </tr>
  
    <tr>
      <th align="right">stringIndexed[1]</th>
      <td align="left">
        <html:text property="stringIndexed[1]" size="32"/>
      </td>
      <th align="right">nested.stringIndexed[1]</th>
      <td align="left">
        <html:text property="nested.stringIndexed[1]" size="32"/>
      </td>
    </tr>
  
    <tr>
      <td>&nbsp;</td>
      <td align="right">
        <html:submit>Save</html:submit>
      </td>
      <td align="left">
        <html:reset>Reset</html:reset>
        <html:cancel>Cancel</html:cancel>
      </td>
      <td>&nbsp;</td>
    </tr>
  
  </table>
  
  </html:form>
  
  
  </html:html>
  
  
  
  1.1                  jakarta-struts/web/exercise-taglib/html-select.jsp
  
  Index: html-select.jsp
  ===================================================================
  <%@ page language="java"%>
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
  <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
  <html:html>
  <head>
  <title>Test html:select Tag</title>
  <%
    String multipleValues[] =
     { "Multiple 0", "Multiple 1", "Multiple 2", "Multiple 3", "Multiple 4",
       "Multiple 5", "Multiple 6", "Multiple 7", "Multiple 8", "Multiple 9" };
    pageContext.setAttribute("multipleValues", multipleValues);
  %>
  </head>
  <body bgcolor="white">
  
  <div align="center">
  <h1>Test struts-html Select Tag</h1>
  </div>
  
  Whatever changes you make to properties should be reflected when the page
  is redisplayed.  Press "Save" to update, or "Cancel" to return to the
  main menu.
  
  <html:form action="html-select.do">
  <table border="0" width="100%">
  
    <tr>
      <th align="right">Single Select Allowed:</th>
      <td align="left">
        <html:select property="singleSelect" size="10">
          <html:option value="Single 0">Single 0</html:option>
          <html:option value="Single 1">Single 1</html:option>
          <html:option value="Single 2">Single 2</html:option>
          <html:option value="Single 3">Single 3</html:option>
          <html:option value="Single 4">Single 4</html:option>
          <html:option value="Single 5">Single 5</html:option>
          <html:option value="Single 6">Single 6</html:option>
          <html:option value="Single 7">Single 7</html:option>
          <html:option value="Single 8">Single 8</html:option>
          <html:option value="Single 9">Single 9</html:option>
        </html:select>
      </td>
    </tr>
  
    <tr>
      <th align="right">Multiple Select Allowed:</th>
      <td align="left">
        <html:select property="multipleSelect" size="10" multiple="true">
          <html:options name="multipleValues" labelName="multipleValues"/>
        </html:select>
      </td>
    </tr>
  
    <tr>
      <td align="right">
        <html:submit>Save</html:submit>
      </td>
      <td align="left">
        <html:reset>Reset</html:reset>
        <html:cancel>Cancel</html:cancel>
      </td>
    </tr>
  
  </table>
  
  </html:form>
  
  
  </html:html>
  
  
  
  1.1                  jakarta-struts/web/exercise-taglib/html-multibox.jsp
  
  Index: html-multibox.jsp
  ===================================================================
  <%@ page language="java"%>
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
  <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
  <html:html>
  <head>
  <title>Test html:multibox Tag</title>
  </head>
  <body bgcolor="white">
  
  <div align="center">
  <h1>Test struts-html Property Setters</h1>
  </div>
  
  Whatever changes you make to properties should be reflected when the page
  is redisplayed.  When first started, all of the listed checkboxes should
  be selected.  Press "Save" to update, or "Cancel" to return to the
  main menu.
  
  <html:form action="html-multibox.do">
  <table border="0" width="100%">
  
    <tr>
      <th align="center" colspan="4">String Array Values</th>
    </tr>
  
    <tr>
      <th align="right">String 0</th>
      <td align="left">
        <html:multibox property="stringMultibox">
          String 0
        </html:multibox>
      </td>
      <th align="right">(nested) String 0</th>
      <td align="left">
        <html:multibox property="nested.stringMultibox" value="String 0"/>
      </td>
    </tr>
  
    <tr>
      <th align="right">String 1</th>
      <td align="left">
        <html:multibox property="stringMultibox">
          String 1
        </html:multibox>
      </td>
      <th align="right">(nested) String 1</th>
      <td align="left">
        <html:multibox property="nested.stringMultibox" value="String 1"/>
      </td>
    </tr>
  
    <tr>
      <th align="right">String 2</th>
      <td align="left">
        <html:multibox property="stringMultibox">
          String 2
        </html:multibox>
      </td>
      <th align="right">(nested) String 2</th>
      <td align="left">
        <html:multibox property="nested.stringMultibox" value="String 2"/>
      </td>
    </tr>
  
    <tr>
      <th align="right">String 3</th>
      <td align="left">
        <html:multibox property="stringMultibox">
          String 3
        </html:multibox>
      </td>
      <th align="right">(nested) String 3</th>
      <td align="left">
        <html:multibox property="nested.stringMultibox" value="String 3"/>
      </td>
    </tr>
  
    <tr>
      <th align="right">String 4</th>
      <td align="left">
        <html:multibox property="stringMultibox">
          String 4
        </html:multibox>
      </td>
      <th align="right">(nested) String 4</th>
      <td align="left">
        <html:multibox property="nested.stringMultibox" value="String 4"/>
      </td>
    </tr>
  
    <tr>
      <th align="center" colspan="4">Integer Array Values</th>
    </tr>
  
    <tr>
      <th align="right">0</th>
      <td align="left">
        <html:multibox property="intMultibox" value="0"/>
      </td>
      <th align="right">(nested) 0</th>
      <td align="left">
        <html:multibox property="nested.intMultibox">
          0
        </html:multibox>
      </td>
    </tr>
  
    <tr>
      <th align="right">10</th>
      <td align="left">
        <html:multibox property="intMultibox" value="10"/>
      </td>
      <th align="right">(nested) 10</th>
      <td align="left">
        <html:multibox property="nested.intMultibox">
          10
        </html:multibox>
      </td>
    </tr>
  
    <tr>
      <th align="right">20</th>
      <td align="left">
        <html:multibox property="intMultibox" value="20"/>
      </td>
      <th align="right">(nested) 20</th>
      <td align="left">
        <html:multibox property="nested.intMultibox">
          20
        </html:multibox>
      </td>
    </tr>
  
    <tr>
      <th align="right">30</th>
      <td align="left">
        <html:multibox property="intMultibox" value="30"/>
      </td>
      <th align="right">(nested) 30</th>
      <td align="left">
        <html:multibox property="nested.intMultibox">
          30
        </html:multibox>
      </td>
    </tr>
  
    <tr>
      <th align="right">40</th>
      <td align="left">
        <html:multibox property="intMultibox" value="40"/>
      </td>
      <th align="right">(nested) 40</th>
      <td align="left">
        <html:multibox property="nested.intMultibox">
          40
        </html:multibox>
      </td>
    </tr>
  
    <tr>
      <td>&nbsp;</td>
      <td align="right">
        <html:submit>Save</html:submit>
      </td>
      <td align="left">
        <html:reset>Reset</html:reset>
        <html:cancel>Cancel</html:cancel>
      </td>
      <td>&nbsp;</td>
    </tr>
  
  </table>
  
  </html:form>
  
  
  </html:html>
  
  
  
  1.1                  jakarta-struts/web/exercise-taglib/bean-write.jsp
  
  Index: bean-write.jsp
  ===================================================================
  <%@ page language="java" %>
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  <html>
  <head>
  <title>Test struts-bean:write Tag</title>
  </head>
  <body bgcolor="white">
  
  <div align="center">
  <h1>Test struts-bean:write Tag</h1>
  </div>
  
  <h3>Test 1 -- Scalar Variable Lookups</h3>
  
  <%
    pageContext.setAttribute("test1.boolean", new Boolean(true));
    pageContext.setAttribute("test1.double", new Double(321.0));
    pageContext.setAttribute("test1.float", new Float((float) 123.0));
    pageContext.setAttribute("test1.int", new Integer(123));
    pageContext.setAttribute("test1.long", new Long(321));
    pageContext.setAttribute("test1.short", new Short((short) 987));
    pageContext.setAttribute("test1.string", "This is a string");
  %>
  
  <table border="1">
  <tr>
    <th>Data Type</th>
    <th>Correct Value</th>
    <th>Test Result</th>
  </tr>
  <tr>
    <td>boolean</td>
    <td><%= pageContext.getAttribute("test1.boolean") %></td>
    <td><bean:write name="test1.boolean"/></td>
  </tr>
  <tr>
    <td>double</td>
    <td><%= pageContext.getAttribute("test1.double") %></td>
    <td><bean:write name="test1.double"/></td>
  </tr>
  <tr>
    <td>float</td>
    <td><%= pageContext.getAttribute("test1.float") %></td>
    <td><bean:write name="test1.float"/></td>
  </tr>
  <tr>
    <td>int</td>
    <td><%= pageContext.getAttribute("test1.int") %></td>
    <td><bean:write name="test1.int"/></td>
  </tr>
  <tr>
    <td>long</td>
    <td><%= pageContext.getAttribute("test1.long") %></td>
    <td><bean:write name="test1.long"/></td>
  </tr>
  <tr>
    <td>short</td>
    <td><%= pageContext.getAttribute("test1.short") %></td>
    <td><bean:write name="test1.short"/></td>
  </tr>
  <tr>
    <td>String</td>
    <td><%= pageContext.getAttribute("test1.string") %></td>
    <td><bean:write name="test1.string"/></td>
  </tr>
  </table>
  
  <h3>Test 2 -- Scalar Property Lookups</h3>
  
  <jsp:useBean id="test2" scope="page" 
class="org.apache.struts.exercise-taglib.TestBean"/>
  
  <table border="1">
  <tr>
    <th>Data Type</th>
    <th>Correct Value</th>
    <th>Test Result</th>
  </tr>
  <tr>
    <td>boolean</td>
    <td><jsp:getProperty name="test2" property="booleanProperty"/>
    <td><bean:write name="test2" property="booleanProperty"/></td>
  </tr>
  <tr>
    <td>double</td>
    <td><jsp:getProperty name="test2" property="doubleProperty"/></td>
    <td><bean:write name="test2" property="doubleProperty"/></td>
  </tr>
  <tr>
    <td>float</td>
    <td><jsp:getProperty name="test2" property="floatProperty"/></td>
    <td><bean:write name="test2" property="floatProperty"/></td>
  </tr>
  <tr>
    <td>int</td>
    <td><jsp:getProperty name="test2" property="intProperty"/></td>
    <td><bean:write name="test2" property="intProperty"/></td>
  </tr>
  <tr>
    <td>long</td>
    <td><jsp:getProperty name="test2" property="longProperty"/></td>
    <td><bean:write name="test2" property="longProperty"/></td>
  </tr>
  <tr>
    <td>short</td>
    <td><jsp:getProperty name="test2" property="shortProperty"/></td>
    <td><bean:write name="test2" property="shortProperty"/></td>
  </tr>
  <tr>
    <td>String</td>
    <td><jsp:getProperty name="test2" property="stringProperty"/></td>
    <td><bean:write name="test2" property="stringProperty"/></td>
  </tr>
  </table>
  
  <h3>Test 3 - Integer Array And Indexed Lookups</h3>
  
  <jsp:useBean id="test3" scope="page" 
class="org.apache.struts.exercise-taglib.TestBean"/>
  
  <table border="1">
  <tr>
    <th>Correct Value</th>
    <th>Array Result</th>
    <th>Indexed Result</th>
  </tr>
  <% for (int index = 0; index < 5; index++) { %>
    <tr>
      <td><%= index * 10 %></td>
      <td><bean:write name="test3" property='<%= "intArray[" + index + "]" %>'/></td>
      <td><bean:write name="test3" property='<%= "intIndexed[" + index + "]" %>'/></td>
    </tr>
  <% } %>
  </table>
  
  
  <h3>Test 4 - String Array And Indexed Lookups</h3>
  
  <jsp:useBean id="test4" scope="page" 
class="org.apache.struts.exercise-taglib.TestBean"/>
  
  <table border="1">
  <tr>
    <th>Correct Value</th>
    <th>Array Result</th>
    <th>Indexed Result</th>
  </tr>
  <% for (int index = 0; index < 5; index++) { %>
    <tr>
      <td><%= "String " + index %></td>
      <td><bean:write name="test4" property='<%= "stringArray[" + index + "]" 
%>'/></td>
      <td><bean:write name="test4" property='<%= "stringIndexed[" + index + "]" 
%>'/></td>
    </tr>
  <% } %>
  </table>
  
  
  <h3>Test 5 -- Nested Scalar Property Lookups</h3>
  
  <jsp:useBean id="test5" scope="page" 
class="org.apache.struts.exercise-taglib.TestBean"/>
  
  <table border="1">
  <tr>
    <th>Data Type</th>
    <th>Correct Value</th>
    <th>Test Result</th>
  </tr>
  <tr>
    <td>boolean</td>
    <td><jsp:getProperty name="test5" property="booleanProperty"/>
    <td><bean:write name="test5" property="nested.booleanProperty"/></td>
  </tr>
  <tr>
    <td>double</td>
    <td><jsp:getProperty name="test5" property="doubleProperty"/></td>
    <td><bean:write name="test5" property="nested.doubleProperty"/></td>
  </tr>
  <tr>
    <td>float</td>
    <td><jsp:getProperty name="test5" property="floatProperty"/></td>
    <td><bean:write name="test5" property="nested.floatProperty"/></td>
  </tr>
  <tr>
    <td>int</td>
    <td><jsp:getProperty name="test5" property="intProperty"/></td>
    <td><bean:write name="test5" property="nested.intProperty"/></td>
  </tr>
  <tr>
    <td>long</td>
    <td><jsp:getProperty name="test5" property="longProperty"/></td>
    <td><bean:write name="test5" property="nested.longProperty"/></td>
  </tr>
  <tr>
    <td>short</td>
    <td><jsp:getProperty name="test5" property="shortProperty"/></td>
    <td><bean:write name="test5" property="nested.shortProperty"/></td>
  </tr>
  <tr>
    <td>String</td>
    <td><jsp:getProperty name="test5" property="stringProperty"/></td>
    <td><bean:write name="test5" property="nested.stringProperty"/></td>
  </tr>
  </table>
  
  <h3>Test 6 - Nested Integer Array And Indexed Lookups</h3>
  
  <jsp:useBean id="test6" scope="page" 
class="org.apache.struts.exercise-taglib.TestBean"/>
  
  <table border="1">
  <tr>
    <th>Correct Value</th>
    <th>Array Result</th>
    <th>Indexed Result</th>
  </tr>
  <% for (int index = 0; index < 5; index++) { %>
    <tr>
      <td><%= index * 10 %></td>
      <td><bean:write name="test6" property='<%= "nested.intArray[" + index + "]" 
%>'/></td>
      <td><bean:write name="test6" property='<%= "nested.intIndexed[" + index + "]" 
%>'/></td>
    </tr>
  <% } %>
  </table>
  
  
  </body>
  </html>
  
  
  
  
  1.1                  jakarta-struts/web/exercise-taglib/bean-size.jsp
  
  Index: bean-size.jsp
  ===================================================================
  <%@ page language="java" %>
  <%@ taglib uri="/WEB-INF/struts-bean.tld"  prefix="bean" %>
  <html>
  <head>
  <title>Test struts-bean Size Tag</title>
  </head>
  <body bgcolor="white">
  
  <%
      java.util.ArrayList data = new java.util.ArrayList();
      data.add("First");
      data.add("Second");
      data.add("Third");
      data.add("Fourth");
      data.add("Fifth");
      pageContext.setAttribute("list", data, PageContext.PAGE_SCOPE);
      java.util.HashMap temp = new java.util.HashMap();
      temp.put("First", "0");
      temp.put("Second", "1");
      temp.put("Third", "2");
      temp.put("Fourth", "3");
      temp.put("Fifth", "4");
      pageContext.setAttribute("map", temp, PageContext.PAGE_SCOPE);
  %>
  <bean:size id="dataSize" collection="<%= data %>"/>
  <bean:size id="tempSize" collection="<%= temp %>"/>
  
  <div align="center">
  <h1>Test struts-bean Size Tag</h1>
  </div>
  
  <jsp:useBean id="bean" scope="page" 
class="org.apache.struts.exercise-taglib.TestBean"/>
  <bean:size id="stringSize" name="bean" property="stringArray"/>
  <bean:size id="intSize" name="bean" property="intArray"/>
  <jsp:useBean id="list" scope="page" class="java.util.ArrayList"/>
  <bean:size id="listSize" name="list"/>
  <jsp:useBean id="map" scope="page" class="java.util.HashMap"/>
  <bean:size id="mapSize" name="map"/>
  
  <table border="1">
    <tr>
      <th>Collection Type</th>
      <th>Correct Value</th>
      <th>Test Result</th>
    </tr>
    <tr>
      <td>Bean (List)</td>
      <td align="center"><%= list.size() %></td>
      <td align="center"><bean:write name="listSize"/></td>
    </tr>
    <tr>
      <td>Bean (Map)</td>
      <td align="center"><%= map.size() %></td>
      <td align="center"><bean:write name="mapSize"/></td>
    </tr>
    <tr>
      <td>Collection (List)</td>
      <td align="center"><%= data.size() %></td>
      <td align="center"><bean:write name="dataSize"/></td>
    </tr>
    <tr>
      <td>Collection (Map)</td>
      <td align="center"><%= temp.size() %></td>
      <td align="center"><bean:write name="tempSize"/></td>
    </tr>
    <tr>
      <td>Property (int[])</td>
      <td align="center"><% int intValues[] = bean.getIntArray(); 
out.print(intValues.length); %></td>
      <td align="center"><bean:write name="intSize"/></td>
    </tr>
    <tr>
      <td>Property (String[])</td>
      <td align="center"><% String stringValues[] = bean.getStringArray(); 
out.print(stringValues.length); %></td>
      <td align="center"><bean:write name="stringSize"/></td>
    </tr>
  </table>
  
  </html>
  </body>
  
  
  
  1.1                  jakarta-struts/web/exercise-taglib/bean-resource.jsp
  
  Index: bean-resource.jsp
  ===================================================================
  <%@ page language="java" %>
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  <html>
  <head>
  <title>Test struts-bean:resource Tag</title>
  </head>
  <body bgcolor="white">
  
  <div align="center">
  <h1>Test struts-bean:resource Tag</h1>
  </div>
  <bean:resource id="webxml" name="/WEB-INF/web.xml"/>
  
  <p>Display the contents of the <code>WEB-INF/web.xml</code> resource for this
  web application, with no filtering.</p>
  <hr>
  <pre>
  <%= webxml %>
  </pre>
  <hr>
  
  <p>Display the contents of the <code>WEB-INF/web.xml</code> resource for this
  web application, with filtering.</p>
  <hr>
  <pre>
  <bean:write name="webxml" filter="true"/>
  </pre>
  <hr>
  
  </body>
  </html>
  
  
  
  1.1                  jakarta-struts/web/exercise-taglib/bean-parameter.jsp
  
  Index: bean-parameter.jsp
  ===================================================================
  <%@ page language="java" %>
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  <html>
  <head>
  <title>Test struts-bean:parameter Tag</title>
  </head>
  <body bgcolor="white">
  
  <div align="center">
  <h1>Test struts-bean:parameter Tag</h1>
  </div>
  
  <p>If called from the <code>index.jsp</code> page, two request parameters will
  be included and their values displayed below.  If you call this page without
  including the appropriate request parameters, you will receive a JSP runtime
  error instead.</p>
  
  <bean:parameter id="param1" name="param1"/>
  <bean:parameter id="param2" name="param2"/>
  <bean:parameter id="param3" name="param3" value="UNKNOWN VALUE"/>
  
  <table border="1">
    <tr>
      <th>Parameter Name</th>
      <th>Correct Value</th>
      <th>Test Result</th>
    </tr>
    <tr>
      <td>param1</td>
      <td>value1</td>
      <td><%= param1 %></td>
    </tr>
    <tr>
      <td>param2</td>
      <td>value2</td>
      <td><%= param2 %></td>
    </tr>
    <tr>
      <td>param3</td>
      <td>UNKNOWN VALUE</td>
      <td><%= param3 %></td>
    </tr>
  </table>
  
  </body>
  </html>
  
  
  
  1.1                  jakarta-struts/web/exercise-taglib/bean-include.jsp
  
  Index: bean-include.jsp
  ===================================================================
  <%@ page language="java" %>
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  <html>
  <head>
  <title>Test struts-bean:include Tag</title>
  </head>
  <body bgcolor="white">
  
  <div align="center">
  <h1>Test struts-bean:include Tag</h1>
  </div>
  
  <bean:include id="index" page="/index.jsp"/>
  
  <p>Display the contents returned by invoking <code>/index.jsp</code>
  directly, with no filtering.</p>
  <hr>
  <pre>
  <%= index %>
  </pre>
  <hr>
  
  <p>Display the contents returned by invoking <code>/index.jsp</code>
  directly, with filtering.</p>
  <hr>
  <pre>
  <bean:write name="index" filter="true"/>
  </pre>
  </hr>
  
  </body>
  </html>
  
  
  
  1.1                  jakarta-struts/web/exercise-taglib/bean-header.jsp
  
  Index: bean-header.jsp
  ===================================================================
  <%@ page language="java" %>
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  <html>
  <head>
  <title>Test struts-bean:header Tag</title>
  </head>
  <body bgcolor="white">
  
  <div align="center">
  <h1>Test struts-bean:header Tag</h1>
  </div>
  
  Display the values of the headers included in this request.<br><br>
  <%
     java.util.Enumeration names =
       ((HttpServletRequest) request).getHeaderNames();
  %>
  
  <table border="1">
    <tr>
      <th>Header Name</th>
      <th>Header Value</th>
    </tr>
  <%
    while (names.hasMoreElements()) {
      String name = (String) names.nextElement();
  %>
      <bean:header id="head" name="<%= name %>"/>
      <tr>
        <td><%= name %></td>
        <td><%= head %></td>
      </tr>
  <%
    }
  %>
    <bean:header id="dummy" name="UNKNOWN-HEADER" value="UNKNOWN VALUE"/>
    <tr>
      <td>UNKNOWN HEADER</td>
      <td><bean:write name="dummy"/></td>
    </tr>
  </table>
  
  </body>
  </html>
  
  
  
  1.1                  jakarta-struts/web/exercise-taglib/bean-define.jsp
  
  Index: bean-define.jsp
  ===================================================================
  <%@ page language="java" %>
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  <html>
  <head>
  <title>Test struts-bean:define Tag</title>
  </head>
  <body bgcolor="white">
  
  <div align="center">
  <h1>Test struts-bean:define Tag</h1>
  </div>
  
  <h3>Test 1 -- Direct Scalar Variable Defines</h3>
  
  <jsp:useBean id="test1" scope="page" 
class="org.apache.struts.exercise-taglib.TestBean"/>
  
  <bean:define id="test1_boolean" name="test1" property="booleanProperty"/>
  <bean:define id="test1_double" name="test1" property="doubleProperty"/>
  <bean:define id="test1_float" name="test1" property="floatProperty"/>
  <bean:define id="test1_int" name="test1" property="intProperty"/>
  <bean:define id="test1_long" name="test1" property="longProperty"/>
  <bean:define id="test1_short" name="test1" property="shortProperty"/>
  <bean:define id="test1_string" name="test1" property="stringProperty"/>
  <bean:define id="test1_value" value="ABCDE"/>
  
  <table border="1">
    <tr>
      <th>Data Type</th>
      <th>Correct Value</th>
      <th>Test Result</th>
    </tr>
    <tr>
      <td>boolean</td>
      <td><jsp:getProperty name="test1" property="booleanProperty"/></td>
      <td><%= test1_boolean %></td>
    </tr>
    <tr>
      <td>double</td>
      <td><jsp:getProperty name="test1" property="doubleProperty"/></td>
      <td><%= test1_double %></td>
    </tr>
    <tr>
      <td>float</td>
      <td><jsp:getProperty name="test1" property="floatProperty"/></td>
      <td><%= test1_float %></td>
    </tr>
    <tr>
      <td>int</td>
      <td><jsp:getProperty name="test1" property="intProperty"/></td>
      <td><%= test1_int %></td>
    </tr>
    <tr>
      <td>long</td>
      <td><jsp:getProperty name="test1" property="longProperty"/></td>
      <td><%= test1_long %></td>
    </tr>
    <tr>
      <td>short</td>
      <td><jsp:getProperty name="test1" property="shortProperty"/></td>
      <td><%= test1_short %></td>
    </tr>
    <tr>
      <td>string</td>
      <td><jsp:getProperty name="test1" property="stringProperty"/></td>
      <td><%= test1_string %></td>
    </tr>
    <tr>
      <td>value</td>
      <td><bean:write name="test1_value"/></td>
      <td><%= test1_value %></td>
    </tr>
  </table>
  
  
  <h3>Test 2 -- Nested Scalar Variable Defines</h3>
  
  <jsp:useBean id="test2" scope="page" 
class="org.apache.struts.exercise-taglib.TestBean"/>
  
  <bean:define id="test2_boolean" name="test2" property="nested.booleanProperty"/>
  <bean:define id="test2_double" name="test2" property="nested.doubleProperty"/>
  <bean:define id="test2_float" name="test2" property="nested.floatProperty"/>
  <bean:define id="test2_int" name="test2" property="nested.intProperty"/>
  <bean:define id="test2_long" name="test2" property="nested.longProperty"/>
  <bean:define id="test2_short" name="test2" property="nested.shortProperty"/>
  <bean:define id="test2_string" name="test2" property="nested.stringProperty"/>
  
  <table border="1">
    <tr>
      <th>Data Type</th>
      <th>Correct Value</th>
      <th>Test Result</th>
    </tr>
    <tr>
      <td>boolean</td>
      <td><jsp:getProperty name="test2" property="booleanProperty"/></td>
      <td><%= test2_boolean %></td>
    </tr>
    <tr>
      <td>double</td>
      <td><jsp:getProperty name="test2" property="doubleProperty"/></td>
      <td><%= test2_double %></td>
    </tr>
    <tr>
      <td>float</td>
      <td><jsp:getProperty name="test2" property="floatProperty"/></td>
      <td><%= test2_float %></td>
    </tr>
    <tr>
      <td>int</td>
      <td><jsp:getProperty name="test2" property="intProperty"/></td>
      <td><%= test2_int %></td>
    </tr>
    <tr>
      <td>long</td>
      <td><jsp:getProperty name="test2" property="longProperty"/></td>
      <td><%= test2_long %></td>
    </tr>
    <tr>
      <td>short</td>
      <td><jsp:getProperty name="test2" property="shortProperty"/></td>
      <td><%= test2_short %></td>
    </tr>
    <tr>
      <td>string</td>
      <td><jsp:getProperty name="test2" property="stringProperty"/></td>
      <td><%= test2_string %></td>
    </tr>
  </table>
  
  
  </body>
  </html>
  
  
  
  1.1                  jakarta-struts/web/exercise-taglib/bean-cookie.jsp
  
  Index: bean-cookie.jsp
  ===================================================================
  <%@ page language="java" %>
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  <html>
  <head>
  <title>Test struts-bean:cookie Tag</title>
  </head>
  <body bgcolor="white">
  
  <div align="center">
  <h1>Test struts-bean:cookie Tag</h1>
  </div>
  
  <p>Display the properties of our current session ID cookie (if there is
  one):</p>
  
  <bean:cookie id="sess" name="JSESSIONID" value="JSESSIONID-IS-UNDEFINED"/>
  
  <table border="1">
    <tr>
      <th>Property Name</th>
      <th>Correct Value</th>
      <th>Test Result</th>
    </tr>
    <tr>
      <td>comment</td>
      <td><jsp:getProperty name="sess" property="comment"/></td>
      <td><bean:write name="sess" property="comment"/></td>
    </tr>
    <tr>
      <td>domain</td>
      <td><jsp:getProperty name="sess" property="domain"/></td>
      <td><bean:write name="sess" property="domain"/></td>
    </tr>
    <tr>
      <td>maxAge</td>
      <td><jsp:getProperty name="sess" property="maxAge"/></td>
      <td><bean:write name="sess" property="maxAge"/></td>
    </tr>
    <tr>
      <td>name</td>
      <td><jsp:getProperty name="sess" property="name"/></td>
      <td><bean:write name="sess" property="name"/></td>
    </tr>
    <tr>
      <td>path</td>
      <td><jsp:getProperty name="sess" property="path"/></td>
      <td><bean:write name="sess" property="path"/></td>
    </tr>
    <tr>
      <td>secure</td>
      <td><jsp:getProperty name="sess" property="secure"/></td>
      <td><bean:write name="sess" property="secure"/></td>
    </tr>
    <tr>
      <td>value</td>
      <td><jsp:getProperty name="sess" property="value"/></td>
      <td><bean:write name="sess" property="value"/></td>
    </tr>
    <tr>
      <td>version</td>
      <td><jsp:getProperty name="sess" property="version"/></td>
      <td><bean:write name="sess" property="version"/></td>
    </tr>
  </table>
  
  <br><br>
  
  <p>Display the properties of an undefined cookie that was given the default
  value <code>UNKNOWN_VALUE</code>:</p>
  
  <bean:cookie id="dummy" name="UNKNOWN_COOKIE" value="UNKNOWN_VALUE"/>
  
  <table border="1">
    <tr>
      <th>Property Name</th>
      <th>Correct Value</th>
      <th>Test Result</th>
    </tr>
    <tr>
      <td>comment</td>
      <td><jsp:getProperty name="dummy" property="comment"/></td>
      <td><bean:write name="dummy" property="comment"/></td>
    </tr>
    <tr>
      <td>domain</td>
      <td><jsp:getProperty name="dummy" property="domain"/></td>
      <td><bean:write name="dummy" property="domain"/></td>
    </tr>
    <tr>
      <td>maxAge</td>
      <td><jsp:getProperty name="dummy" property="maxAge"/></td>
      <td><bean:write name="dummy" property="maxAge"/></td>
    </tr>
    <tr>
      <td>name</td>
      <td><jsp:getProperty name="dummy" property="name"/></td>
      <td><bean:write name="dummy" property="name"/></td>
    </tr>
    <tr>
      <td>path</td>
      <td><jsp:getProperty name="dummy" property="path"/></td>
      <td><bean:write name="dummy" property="path"/></td>
    </tr>
    <tr>
      <td>secure</td>
      <td><jsp:getProperty name="dummy" property="secure"/></td>
      <td><bean:write name="dummy" property="secure"/></td>
    </tr>
    <tr>
      <td>value</td>
      <td><jsp:getProperty name="dummy" property="value"/></td>
      <td><bean:write name="dummy" property="value"/></td>
    </tr>
    <tr>
      <td>version</td>
      <td><jsp:getProperty name="dummy" property="version"/></td>
      <td><bean:write name="dummy" property="version"/></td>
    </tr>
  </table>
  
  </body>
  </html>
  
  
  

Reply via email to