cedric      02/02/18 06:55:50

  Added:       contrib/tiles/web/blank/tiles body.jsp simpleMenu.jsp
               contrib/tiles/web/blank/layouts classicLayout.jsp menu.jsp
                        menuNoStruts.jsp vboxLayout.jsp
               contrib/tiles/web/blank/tiles/common footer.jsp header.jsp
               contrib/tiles/web/blank index.jsp templateNoDef.jsp
               contrib/tiles/web/blank/images struts-power.gif
               contrib/tiles/web/blank/WEB-INF tiles-defs.xml web.xml
  Log:
  Add new tiles-blank webapp. This webapp isn't build inside Struts build mechanism.
  Check tiles build.properties file to enable build.
  
  Revision  Changes    Path
  1.1                  jakarta-struts/contrib/tiles/web/blank/tiles/body.jsp
  
  Index: body.jsp
  ===================================================================
  <%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %>
  
  <table bgcolor="#C0C0C0" cellspacing="2" cellpadding="2" border="0" width="100%" 
align="center">
  <tr>
      <td align="center" >
          <font color="#023264" size="+2">
            <em>                  This is a body  !               </em>
                <br>
                
            <em>                                                  </em>
          </font>
        </td>
  </tr>
  </table>
  
  
  
  1.1                  jakarta-struts/contrib/tiles/web/blank/tiles/simpleMenu.jsp
  
  Index: simpleMenu.jsp
  ===================================================================
  <%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %>
  
  <table cellspacing="2" cellpadding="2" border="0" width="15%">
  <tr>
      <td  bgcolor="#0000FF"> Documentation</td>
  </tr>
  <tr>
      <td align="right"> <a href="<%=request.getContextPath()%>/index.jsp" 
>Home</a></td>
  </tr>
  </table>
  
  
  
  1.1                  jakarta-struts/contrib/tiles/web/blank/layouts/classicLayout.jsp
  
  Index: classicLayout.jsp
  ===================================================================
  <%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %>
  
  <%-- Layout Tiles 
    This layout create a html page with <header> and <body> tags. It render
     a header, left menu, body and footer tile.
    @param title String use in page title
    @param header Header tile (jsp url or definition name)
    @param menu Menu 
    @param body Body
    @param footer Footer
  --%>
  <HTML>
    <HEAD>
        <%-- <link rel=stylesheet 
href="<%=request.getContextPath()%>/layouts/stylesheet.css" type="text/css"> --%>
      <title><tiles:getAsString name="title"/></title>
        
    </HEAD>
  
  <body bgcolor="#ffffff" text="#000000" link="#023264" alink="#023264" 
vlink="#023264">
  <table border="0" width="100%" cellspacing="5">
  <tr>
    <td colspan="2"><tiles:insert attribute="header" /></td>
  </tr>
  <tr>
    <td width="140" valign="top">
      <tiles:insert attribute='menu'/>
    </td>
    <td valign="top"  align="left">
      <tiles:insert attribute='body' />
    </td>
  </tr>
  <tr>
    <td colspan="2">
      <tiles:insert attribute="footer" />
    </td>
  </tr>
  </table>
  </body>
  </html>
  
  
  
  
  1.1                  jakarta-struts/contrib/tiles/web/blank/layouts/menu.jsp
  
  Index: menu.jsp
  ===================================================================
  <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  <%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %>
  <%@ page import="java.util.Iterator" %>
  
  
  <%-- Menu Layout
    This layout render a menu with links.
    It takes as parameter the title, and a list of items. Each item is a bean with 
following properties :
    value, href, icon, tooltip.
    @param title Menu title
    @param items list of items. Items are beans whith following properties : 
   --%>
  
  
  
  <%-- Push tiles attributes in page context --%>
  <tiles:importAttribute />
  
  <table>
  <logic:present name="title">
  <tr>
    <th colspan=2>
      <div align="left"><strong><tiles:getAsString name="title"/></strong></div>
    </th>
  </tr>
  </logic:present>
  
  <%-- iterate on items list --%>
  <logic:iterate id="item" name="items" type="org.apache.struts.tiles.beans.MenuItem" >
  
  <%  // Add site url if link start with "/"
    String link = item.getLink();
        if(link.startsWith("/") ) link = request.getContextPath() + link;
  %>
  <tr>
    <td width="10" valign="top" ></td>
    <td valign="top"  >
          <font size="-1"><a href="<%=link%>">
  <logic:notPresent name="item" property="icon"><%=item.getValue()%></logic:notPresent>
  <logic:present name="item" property="icon">
        <%  // Add site url if link start with "/"
          String icon = item.getIcon();
                if(icon.startsWith("/") ) icon = request.getContextPath() + icon;
        %>
  <img src='<%=request.getContextPath()%><bean:write name="item" property="icon" 
scope="page"/>'
         alt='<bean:write name="item" property="tooltip" scope="page" ignore="true"/>' 
/></logic:present></a>
          </font>
    </td>
  </tr>
  </logic:iterate>
  </table>
  
  
  
  1.1                  jakarta-struts/contrib/tiles/web/blank/layouts/menuNoStruts.jsp
  
  Index: menuNoStruts.jsp
  ===================================================================
  <%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %>
  <%@ page import="java.util.Iterator" %>
  
  
  <%-- Menu Layout
    This layout render a menu with links.
    This implementation doesn't use any Struts tags. If you also use Struts, please 
check
    menu.jsp implementation.
    It takes as parameter the title, and a list of items. Each item is a bean with 
following properties :
    value, href, icon, tooltip.
    @param title Menu title
    @param items list of items. Items are beans whith following properties : 
   --%>
  
  
  
  <%-- Push tiles attributes in page context --%>
  <tiles:importAttribute />
  <% // Make Tile context available for conditional test
    //ComponentContext tileContext = RequestU 
  %>
  <table>
  <logic:present name="title">
  <% if( pageContext.getAttribute("title")!=null) { %>
  <tr>
    <th colspan=2>
      <div align="left"><strong><tiles:getAsString name="title"/></strong></div>
    </th>
  </tr>
  </logic:present>
  <% } // end if %>
  
  <%-- iterate on items list --%>
  <%
    java.util.List list = (java.util.List)pageContext.getAttribute("items");
    java.util.Iterator iterator = list.iterator();
    while( iterator.hasNext() )
      {
        org.apache.struts.tiles.beans.MenuItem item = 
(org.apache.struts.tiles.beans.MenuItem)iterator.next();
  %>
  <logic:iterate id="item" name="items" type="org.apache.struts.tiles.beans.MenuItem" >
  
  <%  // Add site url if link start with "/"
    String link = item.getLink();
        if(link.startsWith("/") ) link = request.getContextPath() + link;
  %>
  <tr>
    <td width="10" valign="top" ></td>
    <td valign="top"  >
          <font size="-1"><a href="<%=link%>">
  <% if( item.getIcon()==null) { %>
    <%=item.getValue()%>
  <% } else { %>  
        <%  // Add site url if link start with "/"
          String icon = item.getIcon();
                if(icon.startsWith("/") ) icon = request.getContextPath() + icon;
        %>
  <img src='<%=request.getContextPath()+item.getIcon()%>'
         alt='<%=request.getContextPath()+item.getTooltip()%>' />
  <% } // end if %>
           </a>
          </font>
    </td>
  </tr>
  
  <% // end iterate
    } // end loop
  %>
  </table>
  
  
  
  1.1                  jakarta-struts/contrib/tiles/web/blank/layouts/vboxLayout.jsp
  
  Index: vboxLayout.jsp
  ===================================================================
  <%@ page import="java.util.Iterator"%>
  <%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %>
  
  <%-- Layout component 
    Render a list of tiles in a vertical column
    @param : list List of names to insert 
    
  --%>
  
  <tiles:useAttribute id="list" name="list" classname="java.util.List" />
  
  <%-- Iterate over names.
    We don't use <iterate> tag because it doesn't allow insert (in JSP1.1)
   --%>
  <%
  Iterator i=list.iterator();
  while( i.hasNext() )
    {
    String name= (String)i.next();
  %>
  <tiles:insert name="<%=name%>" flush="true" />
  <br>
  
  <%
    } // end loop
  %>
  
  
  
  
  1.1                  jakarta-struts/contrib/tiles/web/blank/tiles/common/footer.jsp
  
  Index: footer.jsp
  ===================================================================
  <div align="center">
    <font color="#023264" size="-1">
      <em>         Copyright &copy; 2000, Apache Software Foundation         </em>
        <br>
      <em>                        and Cedric Dumoulin                        </em>
    </font>
  </div>
  <img src="<%=request.getContextPath()%>/images/struts-power.gif" align="right" 
border="0">
  
  
  
  1.1                  jakarta-struts/contrib/tiles/web/blank/tiles/common/header.jsp
  
  Index: header.jsp
  ===================================================================
  <table bgcolor="#C0C0C0" cellspacing="2" cellpadding="2" border="0" width="100%">
  <tr>
      <td align="center" >Tiles Blank Site Example</td>
  </tr>
  </table>
  
  
  
  1.1                  jakarta-struts/contrib/tiles/web/blank/index.jsp
  
  Index: index.jsp
  ===================================================================
  <%@ page language="java" %>
  <%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %>
  
    <%-- Insert a definition described in tiles configuration file 
      Change the definition name to insert another definition.
        It is possible to overload some definition attribute by adding
        some put tags with appropriate name.
    --%>
  <tiles:insert definition="site.index.page" flush="true" />
  
  
  
  1.1                  jakarta-struts/contrib/tiles/web/blank/templateNoDef.jsp
  
  Index: templateNoDef.jsp
  ===================================================================
  <%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %>
  
  
    <%-- Insert a layout rendering requested tiles.
    --%>
  <tiles:insert page="/layouts/classicLayout.jsp" flush="true">
    <tiles:put name="title"  value="Tiles Basic Page" />
    <tiles:put name="header" value="/tiles/common/header.jsp" />
    <tiles:put name="footer" value="/tiles/common/footer.jsp" />
    <tiles:put name="menu"   value="/tiles/simpleMenu.jsp" />
    <tiles:put name="body"   value="/tiles/body.jsp" />
  </tiles:insert>
  
  
  
  1.1                  jakarta-struts/contrib/tiles/web/blank/images/struts-power.gif
  
        <<Binary file>>
  
  
  1.1                  jakarta-struts/contrib/tiles/web/blank/WEB-INF/tiles-defs.xml
  
  Index: tiles-defs.xml
  ===================================================================
   <!DOCTYPE tiles-definitions PUBLIC
         "-//Apache Software Foundation//DTD Tiles Configuration//EN"
         "http://jakarta.apache.org/struts/dtds/tiles-config.dtd";>
  
  <!-- Definitions for Tiles documentation   -->
  
  <tiles-definitions>
  
    <!-- =======================================================  -->
    <!-- Master definition                                                             
         -->
    <!-- =======================================================  -->
  
    <!-- Main page layout used as a root for other pages defintion.
      -->
    <definition name="site.mainLayout" path="/layouts/classicLayout.jsp">
          <put name="title"  value="Tiles Blank Site" />
          <put name="header" value="/tiles/common/header.jsp" />
          <put name="menu"   value="site.menu.bar" />
          <put name="footer" value="/tiles/common/footer.jsp" />
          <put name="body"   value="/tiles/body.jsp" />
    </definition>
  
    <!-- =======================================================  -->
    <!-- Index page definition                                                         
                 -->
    <!-- =======================================================  -->
  
      <!-- This definition inherits from the main definition.
          It overload the page title, and the body used.
          Use the same mechanism to define new pages sharing common 
          properties (here header, menu, footer, layout)
        -->
    <definition name="site.index.page" extends="site.mainLayout" >
          <put name="title"  value="Tiles Blank Site Index" />
          <put name="body"   value="/tiles/body.jsp" />
    </definition>
    
    <!-- =======================================================  -->
    <!-- Menus definitions                                                             
         -->
    <!-- =======================================================  -->
  
    <!-- Menu bar definition 
      This definition describe a "bar" of menu stacked verticaly.
        Each menu is describe elsewhere.
        Add new entry in the list to add new menu.
    -->
  <definition name="site.menu.bar" path="/layouts/vboxLayout.jsp" >
    <putList name="list" >
      <add value="site.menu.links" />
      <add value="site.menu.documentation" />
    </putList>
  </definition>
  
    <!-- Menu description
      A menu has a title and a set of entries rendered as links.
        Add new entry to add new links in menu.
     -->
  <definition name="site.menu.links" path="/layouts/menuNoStruts.jsp" >
    <put name="title" value="Useful Links" />
      <putList name="items" >
        <item value="Home"           
                        link="/index.jsp"             
                        classtype="org.apache.struts.tiles.beans.SimpleMenuItem" />
        <item value="A Menu Item" 
                        link="/templateNoDef.jsp" 
                        classtype="org.apache.struts.tiles.beans.SimpleMenuItem" />
      </putList>
  </definition>
  
    <!-- Another Menu description
      A menu has a title and a set of entries rendered as links.
        Add new entry to add new links in menu.
     -->
  <definition name="site.menu.documentation" path="/layouts/menuNoStruts.jsp" >
    <put name="title" value="Documentation" />
      <putList name="items" >
        <item value="User Guide"           
                        link="/index.jsp"             
                        classtype="org.apache.struts.tiles.beans.SimpleMenuItem" />
        <item value="Tags Index" 
                        link="/index.jsp" 
                        classtype="org.apache.struts.tiles.beans.SimpleMenuItem" />
        <item value="Struts Home" 
                        icon="/images/struts-power.gif"        
                        link="http://www.apache.org"; 
                classtype="org.apache.struts.tiles.beans.SimpleMenuItem" />
      </putList>
  </definition>
  
  
  
  </tiles-definitions>
  
  
  
  1.1                  jakarta-struts/contrib/tiles/web/blank/WEB-INF/web.xml
  
  Index: web.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  
  <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>
  
  <web-app>
  
    <!-- Action Servlet Configuration -->
    <servlet>
      <servlet-name>action</servlet-name>
            <!-- Specify servlet class to use 
                  If you also plan to use Struts, use ActionComponentServlet 
                  If you don't need Struts, use TilesServlet --> 
            <!-- 
<servlet-class>org.apache.struts.tiles.ActionComponentServlet</servlet-class> -->  
      <servlet-class>org.apache.struts.tiles.TilesServlet</servlet-class> 
        
          <!-- Tiles Servlet parameter 
                  Specify configuration file names. There can be several comma 
                  separated file names
                -->     
        <init-param>
        <param-name>definitions-config</param-name>
        <param-value>/WEB-INF/tiles-defs.xml</param-value>
      </init-param>
        
          <!-- Tiles Servlet parameter 
                  Specify Tiles debug level.
                  O : no debug information
                  1 : debug information
                  2 : more debug information
                -->     
      <init-param>
        <param-name>definitions-debug</param-name>
        <param-value>1</param-value>
      </init-param>
        
          <!-- Tiles Servlet parameter 
                Specify Digester debug level. This value is passed to Digester
                  O : no debug information
                  1 : debug information
                  2 : more debug information
                -->     
      <init-param>
        <param-name>definitions-parser-details</param-name>
        <param-value>0</param-value>
      </init-param>
        
          <!-- Tiles Servlet parameter 
                Specify if xml parser should validate the Tiles configuration file.
                true : validate. DTD should be specified in file header.
                false : no validation
                -->     
      <init-param>
        <param-name>definitions-parser-validate</param-name>
        <param-value>true</param-value>
      </init-param>
  
          <!-- Struts configuration, if Struts is used -->
      <init-param>
        <param-name>config</param-name>
        <param-value>/WEB-INF/struts-config.xml</param-value>
      </init-param>
      <init-param>
        <param-name>validate</param-name>
        <param-value>true</param-value>
      </init-param>
      <init-param>
        <param-name>debug</param-name>
        <param-value>2</param-value>
      </init-param>
      <init-param>
        <param-name>detail</param-name>
        <param-value>2</param-value>
      </init-param>
        
      <load-on-startup>2</load-on-startup>
    </servlet>
  
  
    <!-- Action Servlet Mapping -->
    <servlet-mapping>
      <servlet-name>action</servlet-name>
      <url-pattern>*.do</url-pattern>
    </servlet-mapping>
  
  
    <!-- The Welcome File List -->
    <welcome-file-list>
      <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
  
    <!-- Struts Tag Library Descriptor -->
    <taglib>
      <taglib-uri>/WEB-INF/tiles.tld</taglib-uri>
      <taglib-location>/WEB-INF/tiles.tld</taglib-location>
    </taglib>
   
  </web-app>
  
  
  

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

Reply via email to