cmlenz      02/01/28 04:33:58

  Added:       web/taglib-examples index.html jstl_xpath_example.jsp
               web/taglib-examples/WEB-INF web.xml
               web/taglib-examples/images code.gif execute.gif
                        jakarta-logo.gif return.gif slide-logo.gif
  Log:
  start of a webapp containing examples of how to use the taglibs
  
  Revision  Changes    Path
  1.1                  jakarta-slide/web/taglib-examples/index.html
  
  Index: index.html
  ===================================================================
  <html>
    <head>
      <title>Slide Tag Library Examples</title>
    </head>
    <body vlink="#525D76" alink="#525D76" link="#525D76" text="#000000" 
bgcolor="#ffffff">
      <table cellspacing="4" width="100%" border="0">
        <tr>
          <td colspan="2">
            <a href="http://jakarta.apache.org/";><img border="0" alt="The Jakarta 
Project" align="left" src="images/jakarta-logo.gif"></a>
            <a href="http://jakarta.apache.org/slide/";><img border="0" alt="The 
Jakarta Slide Project" align="right" src="images/slide-logo.gif"></a>
          </td>
        </tr>
        <tr>
          <td colspan="2">
            <hr size="1" noshade="">
          </td>
        </tr>
        <tr>
          <td bgcolor="#525D76">
            <font face="arial,helvetica.sanserif" color="#ffffff"><strong>Slide Tag 
Library Examples</strong></a></font>
          </td>
        </tr>
        <tr>
          <td>
            <blockquote>
              <p>
                The <a href="http://jakarta.apache.org/slide/";>Jakarta Slide</a> 
project 
                includes JSP tag libraries to support the creation of web-based 
                presentation layers accessing and displaying content stored in Slide 
                repositories.
              </p>
              <p>
                To keep the tag library code lean, we have to decided to rely on 
existing 
                tag libraries to support basic functionality like iteration and 
                conditionals. Two such libraries are currently supported: 
                <b>Struts 1.x</b> and the <b>JSP Standard Tag Library (JSTL) Early 
                Access</b> releases. The Slide Tag Library cannot effectively be used 
on 
                its own, but requires one of the above fundamental libraries.
              </p>
              <p>
                The following examples demonstrate the features of the Slide tag 
library,
                and its integration with the tag library providing the common 
                functionality.
              </p>
            </blockquote>
          </td>
        </tr>
        <tr>
          <td bgcolor="#525D76">
            <font face="arial,helvetica.sanserif" color="#ffffff"><strong>Slide-Struts 
Tag Library</strong></a></font>
          </td>
        </tr>
        <tr>
          <td>
            <blockquote>
              <p>
                <i>to be written</i>
              </p>
            </blockquote>
          </td>
        </tr>
        <tr>
          <td bgcolor="#525D76">
            <font face="arial,helvetica.sanserif" color="#ffffff"><strong>Slide-JSTL 
Tag Library</strong></a></font>
          </td>
        </tr>
        <tr>
          <td>
            <blockquote>
              <p>
                This variant of the Slide tag library is based on 
                <a href="http://www.jcp.org/jsr/detail/52.jsp";>JSR-052</a>, the 
                JSP Standard Tag Library (JSTL). You can get the early access 
                releases of the reference implementation at 
                <a href="http://jakarta.apache.org/taglibs/";>Jakarta Taglibs</a>.
                Please note that JSTL requires a Java Sevrlet 2.3 and JSP 1.2
                compliant servlet container (like 
                <a href="http://jakarta.apache.org/tomcat/";>Tomcat 4</a>).
              </p>
              <p>
                You will need to provide a couple of libraries by copying them 
                to the <code>WEB-INF/lib</code> directory of this web-app:
                <br><br>
                <table border="0" cellpadding="5" cellspacing="0">
                  <tr>
                    <td><code>js.jar</code></td>
                    <td>
                      <a href="http://www.mozilla.org/rhino/";>Mozilla 
Rhino</a>&nbsp;-&nbsp;
                      A Java implementation of JavaScript/ECMAScript.
                    </td>
                  </tr>
                  <tr>
                    <td><code>jaxen-full.jar</code></td>
                    <td>
                      <a href="http://jaxen.org/";>Jaxen</a>&nbsp;-&nbsp;
                      The XPath engine used by the JSTL XML tag library.
                    </td>
                  </tr>
                  <tr>
                    <td><code>saxpath.jar</code></td>
                    <td>
                      <a href="http://saxpath.org/";>SAXPath</a>&nbsp;-&nbsp;
                      XPath API used by Jaxen.
                    </td>
                  </tr>
                </table>
              </p>
              <p>
                You'll also need a JAXP-based XML-Parser and XSLT-Processor to 
                run some of the examples (see 
                <a href="http://xml.apache.org/";>The Apache XML Project</a> for 
                distributions of Xerces and Xalan).
                Apart from those, the JAR files <code>standard.jar</code>, 
                <code>slide-taglib-common.jar</code> and 
                <code>slide-taglib-jstl.jar</code> should be already included 
                in this web-app.
              </p>
            </blockquote>
            <ul>
              <li>
                <code><b>&lt;slide:content&gt;</b></code> and the JSTL XML 
tags&nbsp;&nbsp;
                <a href='jstl_xpath_example.jsp'><img src='images/execute.gif' 
alt='Execute' border='0'></a>&nbsp;
                <a href='jstl_xpath_example.txt'><img src='images/code.gif' alt='Show 
Source' border='0'></a>
              </li>
            </ul>
          </td>
        </tr>
      </table>
    </body>
  </html>
  
  
  
  1.1                  jakarta-slide/web/taglib-examples/jstl_xpath_example.jsp
  
  Index: jstl_xpath_example.jsp
  ===================================================================
  <%@ taglib uri="http://java.sun.com/jstl/ea/core";  prefix="core" %>
  <%@ taglib uri="http://java.sun.com/jstl/ea/xml";  prefix="xml" %>
  <%@ taglib uri="http://jakarta.apache.org/slide/tags-jstl-1.0";  prefix="slide" %>
  
  <html>
    <head>
      <title>Slide/JSTL Tag Library Example</title>
    </head>
    <body>
      <h1>Slide/JSTL Tag Library Example</h1>
      <p>
        This example uses the JSTL core and xml tag libraries in conjunction with 
        the <code>&lt;slide:content&gt;</code> tag. A web.xml file is retrieved 
        from the Slide repository, parsed and the main servlet-related definitions
        pretty-printed as HTML.
      </p>
      <p>
        <form method='GET'>
          Enter location of a web.xml file in the Slide namespace:<br>
          <core:choose>
            <core:when test="$params.uri != null">
              <input name='uri' type='text' size='80' value='<core:expr 
value="$params.uri[0]" default=""/>'/>
            </core:when>
            <core:otherwise>
              <input name='uri' type='text' size='80' value='/files/WEB-INF/web.xml'/>
            </core:otherwise>
          </core:choose>
          <input type='submit'>
          <input type='reset'>
        </form>
      </p>
      <core:if test="$params.uri != null">
        <slide:node uri="$params.uri[0]">
          <xml:parse var="webxml"><slide:content/></xml:parse>
          <center><h2>Servlets</h2>
          <table bgcolor='#cccccc' border='2' cellpadding='2' cellspacing='2' 
width='90%'>
            <tr>
              <th width="50%">Servlet Name</th>
              <th width="50%">Servlet Class</th>
            </tr>
            <xml:forEach select="$webxml/web-app/servlet">
              <tr>
                <td><xml:expr select="servlet-name"/></td>
                <td><code><xml:expr select="servlet-class"/></code></td>
              </tr>
            </xml:forEach>
          </table></center>
          <center><h2>Servlet-Mappings</h2>
          <table bgcolor='#cccccc' border='2' cellpadding='10' cellspacing='2' 
width='90%'>
            <tr>
              <th width="50%">Servlet Name</th>
              <th width="50%">URL Pattern</th>
            </tr>
            <xml:forEach select="$webxml/web-app/servlet-mapping">
              <tr>
                <td><xml:expr select="servlet-name"/></td>
                <td><code><xml:expr select="url-pattern"/></code></td>
              </tr>
            </xml:forEach>
          </table></center>
        </slide:node>
      </core:if>
      <br><hr>
      <center><a href="index.html"><img src="images/return.gif" alt="Return" 
border="0"></a></center>
    </body>
  </html>
  
  
  
  1.1                  jakarta-slide/web/taglib-examples/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>
    
    <!-- Context Initialization Parameters
         
         The namespace parameter lets you specify the name of the namespace that 
         you want to access through the administration webapp. If you don't 
         specify the namespace parameter, the default namespace will be used, if 
         available. -->
    <context-param>
      <param-name>namespace</param-name>
      <param-value>slide</param-value>
    </context-param>
    
    <!-- Establish the default list of welcome files -->
    <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    
    <!-- Security Contraints -->
    <security-constraint>
      <web-resource-collection>
        <web-resource-name>Slide Tag Libraries Examples</web-resource-name>
        <url-pattern>/*</url-pattern>
      </web-resource-collection>
      <auth-constraint>
        <role-name>root</role-name>
        <role-name>user</role-name>
      </auth-constraint>
    </security-constraint>
    
    <!-- Login Configuration -->
    <login-config>
      <auth-method>BASIC</auth-method>
      <realm-name>Slide Tag Libraries Examples</realm-name>
    </login-config>
    
  </web-app>
  
  
  
  1.1                  jakarta-slide/web/taglib-examples/images/code.gif
  
        <<Binary file>>
  
  
  1.1                  jakarta-slide/web/taglib-examples/images/execute.gif
  
        <<Binary file>>
  
  
  1.1                  jakarta-slide/web/taglib-examples/images/jakarta-logo.gif
  
        <<Binary file>>
  
  
  1.1                  jakarta-slide/web/taglib-examples/images/return.gif
  
        <<Binary file>>
  
  
  1.1                  jakarta-slide/web/taglib-examples/images/slide-logo.gif
  
        <<Binary file>>
  
  

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

Reply via email to