cedric      2003/03/21 16:28:39

  Modified:    web/tiles-documentation/WEB-INF tiles-tests-defs.xml
                        struts-tests-config.xml
  Added:       web/tiles-documentation/test testInclude.jsp
                        showRequestUri.jsp
  Log:
  Add new examples using <logic:iterate>
  
  Revision  Changes    Path
  1.6       +7 -0      
jakarta-struts/web/tiles-documentation/WEB-INF/tiles-tests-defs.xml
  
  Index: tiles-tests-defs.xml
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/web/tiles-documentation/WEB-INF/tiles-tests-defs.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- tiles-tests-defs.xml      29 Dec 2002 21:20:06 -0000      1.5
  +++ tiles-tests-defs.xml      22 Mar 2003 00:28:39 -0000      1.6
  @@ -86,5 +86,12 @@
     <put name="body"  direct="true">second body : body</put>
   </definition>
   
  +  <!-- Test instances -->
  +<definition name="test.action.noforward" path="/test/layout.jsp" >
  +  <put name="title"  value="Test Action with No Forward" />
  +  <put name="header" value="header.jsp" />
  +  <put name="body"   value="showRequestUri.jsp" />
  +</definition>
  +
   
   </tiles-definitions>
  
  
  
  1.3       +6 -0      
jakarta-struts/web/tiles-documentation/WEB-INF/struts-tests-config.xml
  
  Index: struts-tests-config.xml
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/web/tiles-documentation/WEB-INF/struts-tests-config.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- struts-tests-config.xml   29 Dec 2002 21:20:06 -0000      1.2
  +++ struts-tests-config.xml   22 Mar 2003 00:28:39 -0000      1.3
  @@ -58,6 +58,12 @@
         <forward  name="error"   path="anything" />
     </action>
     
  +    <!-- Test Struts action and Tiles integration -->
  +  <action     path="/showRequestURI"
  +                       type="org.apache.struts.webapp.tiles.test.NoForward">
  +      <forward  name="success"        path="test.action.noforward"/>
  +  </action>
  +
     </action-mappings>
   
     
  
  
  
  1.1                  jakarta-struts/web/tiles-documentation/test/testInclude.jsp
  
  Index: testInclude.jsp
  ===================================================================
  <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
  <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
  
  <%-- Test jsp include in a BodyTag (<iterate>).
  --%>
  <%
  java.util.List list = new java.util.ArrayList();
  list.add( "header.jsp" );
  list.add( "body.jsp" );
  int position=0;
  %>
  
   <hr>
   
   <strong>1 request.getRequestDispatcher(uri).include(request, response)</strong>
  
   <logic:iterate id="uri" collection="<%=list%>" type="java.lang.String" >
    <br>
    include number <%= position++ %>
    <br>
     <% // insert the id
     response.flushBuffer();
     response.getWriter().flush();
     //out.flush();
     request.getRequestDispatcher(uri).include(request, response);
     response.getWriter().flush();
     response.flushBuffer();
     %>
   </logic:iterate>
   
  <hr>
  <strong>pageContext.include(page)</strong>
  
   <logic:iterate id="uri" collection="<%=list%>" type="java.lang.String" >
    <br>
    include number <%= position++ %>
    <br>
     <% // insert the id
     pageContext.include(uri);
     %>
   </logic:iterate><hr>
   
  <hr>
  <strong>tiles:insert</strong>
  
   <logic:iterate id="uri" collection="<%=list%>" type="java.lang.String" >
    <br>
    include number <%= position++ %>
    <br>
     <tiles:insert definition="test.layout.test1" flush="false"/>
   </logic:iterate>
  
  <strong>Done</strong>
  
   
  
  
  
  1.1                  jakarta-struts/web/tiles-documentation/test/showRequestUri.jsp
  
  Index: showRequestUri.jsp
  ===================================================================
  <div align="center"><b><i>RequestUri: <%=request.getRequestURI()%> </i></b>
  <b><i>ContextPath: <%=request.getContextPath()%> </i></b>
  
  </div>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to