You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2003/04/13 07:43:05 UTC

cvs commit: avalon-sandbox/merlin/merlin-extensions/merlin-servlet/src/webapp/WEB-INF merlin.tld

mcconnell    2003/04/12 22:43:05

  Added:       merlin/merlin-extensions/merlin-servlet/src/webapp
                        exception.jsp footer.jsp header.jsp index.jsp
               merlin/merlin-extensions/merlin-servlet/src/webapp/WEB-INF
                        merlin.tld
  Log:
  Servlet package additions - a very early cut on a JSL Tag Lib for interaction with merlin components and services.
  
  Revision  Changes    Path
  1.1                  avalon-sandbox/merlin/merlin-extensions/merlin-servlet/src/webapp/exception.jsp
  
  Index: exception.jsp
  ===================================================================
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  
  <!--
  The exception.jsp page handles cascading exception reporting.
  -->
  
  <%@ page isErrorPage="true" %>
  <%@ page import="javax.servlet.jsp.JspException" %>
  <%@ page import="javax.servlet.ServletException" %>
  <%@ page import="org.apache.avalon.assembly.util.ExceptionHelper" %>
  <%! String m_path; %>
  <%! String m_message; %>
  <%
  
      String message = ExceptionHelper.packException( exception.getClass().getName(), exception );
      m_message = message.replaceAll("\n","</br>");
      request.setAttribute( "urn:merlin:page.title", "Merlin Exception Report" );
      String query = request.getQueryString();
      String url = "" + request.getRequestURL();
      if( query != null )
      {
          m_path = url + "?" + query;
      }
      else
      {
          m_path = url;
      }
      pageContext.include("/header.jsp");
  %>
    <table border="0" cellPadding="0" cellSpacing="0" width="100%"> 
     <tr bgcolor="lightsteelblue">
       <td valign="top" colspan="2"><p class="banner">Description</p></td>
     </tr>
    </table>
    
    <p>
  An error occured while attempting to handle the request</br>
  <a href="<%= m_path %>"><%= m_path %></a>
    </p>
  
    <table border="0" cellPadding="3" cellSpacing="0" width="100%"> 
  
      <tr bgcolor="lightsteelblue">
        <td valign="top"><p class="banner">Exception</p></td>
        <td><p class="banner">Message</p></td>
      </tr>
      <tr valign="top">
        <td>
          <p><%= m_message %></p>
        </td>
      </tr>
  
    </table>
    
  <%
      pageContext.include("footer.jsp");
  %>
  
  
  
  1.1                  avalon-sandbox/merlin/merlin-extensions/merlin-servlet/src/webapp/footer.jsp
  
  Index: footer.jsp
  ===================================================================
  </body>
  </html>
  
  
  1.1                  avalon-sandbox/merlin/merlin-extensions/merlin-servlet/src/webapp/header.jsp
  
  Index: header.jsp
  ===================================================================
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  
  <%@ page import="javax.servlet.jsp.JspException" %>
  <%! String m_title; %>
  <%! String[] m_options; %>
  <%! String[] m_actions; %>
  <%! String m_banner; %>
  <%! String m_home; %>
  <%
      m_title = (String) request.getAttribute("urn:merlin:page.title");
      m_options = (String[]) request.getAttribute("urn:merlin:page.options");
      m_actions = (String[]) request.getAttribute("urn:merlin:page.actions");
      m_banner = (String) request.getAttribute("urn:merlin:page.banner");
  
      if( m_title == null ) m_title = "Untitled Page";
      if( m_options == null ) m_options = new String[0];
      if( m_actions == null ) m_actions = new String[0];
      if( m_banner == null ) m_banner = "";
  
      m_home = (String) request.getAttribute("urn:merlin:page.home");
      if( m_home == null ) m_home = "/index.jsp";
  %>
  
  <html>
  
    <head>
      <link rel="stylesheet" type="text/css" 
        href="<%= request.getContextPath() %>/css/merlin.css" title="index" />
      <title><%= m_title %></title>
      <meta HTTP-EQUIV="expires" content="0"/>
      <meta name="description" content="<%= m_title %>"/>
      <meta name="keywords" content="merlin"/>
    </head>
  
    <body background="<%= request.getContextPath() %>/images/Paper.gif">
  
      <table width="100%" border="0" >
        <tr bgcolor="7171A5"> 
          <td width="56%" > 
            <div class="page-title-text" align="left">
              <%= m_title %> 
            </div>
          </td>
        </tr>
        <tr>
          <td>
            <p class="caption"><a href="<%= m_home %>">home</a></p>
          </td>
        </tr>
        <tr height="2" bgcolor="lightsteelblue">
          <td colspan="3" height="2"></td>
        </tr>
        <tr>
          <td>
            <p class="caption">
            <%
                for( int i=0; i<m_options.length; i++ )
                {
                    String option = m_options[i];
                    %>
                    <%= option %>
                    <%
                    if( i < ( m_options.length -1 ) )
                    {
                        %>
                        <%= " | " %>
                        <%
                    }
                    else
                    {
                        %>
                        <%= " &nbsp; " %>
                        <%
                    }
                }
            %>
            </p>
          </td>
       </tr>
       <tr height="2" bgcolor="lightsteelblue">
         <td colspan="3" height="2"></td>
       </tr>
       <tr>
          <td align="left">
            <p class="caption">
            <%
                for( int i=0; i<m_actions.length; i++ )
                {
                    String action = m_actions[i];
                    %>
                    <%= action %>
                    <%
                    if( i < ( m_actions.length -1 ) )
                    {
                        %>
                        <%= " | " %>
                        <%
                    }
                    else
                    {
                        %>
                        <%= " &nbsp; " %>
                        <%
                    }
                }
            %>
            </p>
          </td>
        </tr>
      </table>
  
      <table cellPadding="0" cellSpacing="0" width="100%">
         <tr>
           <td bgcolor="lightsteelblue">
             <p class="banner"> <%= m_banner %> </p>
           </td>
         </tr>
      </table>
  
  
  
  1.1                  avalon-sandbox/merlin/merlin-extensions/merlin-servlet/src/webapp/index.jsp
  
  Index: index.jsp
  ===================================================================
  
  <%@ taglib uri="/WEB-INF/merlin.tld" prefix="merlin" %>
  <%@ page errorPage="exception.jsp" %>
  <%! Object m_adapter; %>
  <% 
      request.setAttribute("urn:merlin:page.title", "Merlin Index" );
      pageContext.include("header.jsp");
  %>
    <merlin:target url="/">
      <p>BLOCK: <merlin:target feature="this"/></p>
    </merlin:target>
  <% 
      pageContext.include("footer.jsp");
  %>
  
  
  
  
  1.1                  avalon-sandbox/merlin/merlin-extensions/merlin-servlet/src/webapp/WEB-INF/merlin.tld
  
  Index: merlin.tld
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1" ?>
  <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
  	"http://java.sun.com/j2ee/dtd/web-jsptaglibrary_1_2.dtd">
  
  <!-- tag library descriptor -->
  
  <taglib>
  
    <tlib-version>1.0</tlib-version>
    <jsp-version>1.2</jsp-version>
    <short-name>merlin</short-name>
    <uri>/WEB-INF/merlin.tld</uri>
    <description>
      Merlin JSP Tag Library
    </description>
  
    <tag>
      <name>target</name>
      <tag-class>org.apache.avalon.merlin.jsp.TargetTag</tag-class>
      <body-content>JSP</body-content>
      <description>
        Tag representing a target object that represents business
        logic resolved from an Merlin Kernel. 
      </description>
  
      <!--
      The url to the component managed by the Merlin Kernel.
      -->
      <attribute>
        <name>url</name>
        <required>false</required>
        <rtexprvalue>true</rtexprvalue>
      </attribute>
  
      <!--
      The header attribute allows the client to supply a sequence of 
      characters that will preceed presentation of the feature or expanded 
      content generated by the tag.
      -->
      <attribute>
        <name>header</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
      </attribute>
  
      <!--
      The footer attribute allows the client to supply a sequence of 
      characters that will follow presentation of the feature or expanded 
      content generated by the tag.
      -->
      <attribute>
        <name>footer</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
      </attribute>
  
      <!--
      The feature attribute instructs the tag to return the named feature.
      Feature names correspond to [get][Name]() operation patterns on 
      the target adapter.
      -->
      <attribute>
        <name>feature</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
      </attribute>
  
      <!--
      The resolve attribute instructs the tag to return another object.
      Resolves names correspond to [get][Feature]() operation patterns on 
      the target object that returns a new target object.
      -->
      <attribute>
        <name>resolve</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
      </attribute>
  
      <!--
      The params attribute may be used in conjunction with feature, expand 
      and resolve attributes to declare supplimentary string arguments.  The
      value supplied to the params attribute is a comma seperated sequence of
      argument values.
      -->
      <attribute>
        <name>params</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
      </attribute>
  
  
      <!--
      The expand attribute instructs the tag to establish an iterator relative
      to the named relationship. Expand names correspond to [get][Feature]() 
      operation patterns on the target adapter.  The object returned from the
      operation must be an instance of java.util.List or java.util.Iterator.
      -->
      <attribute>
        <name>expand</name>
        <required>false</required>
        <rtexprvalue>true</rtexprvalue>
      </attribute>
    </tag>
  
  </taglib>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org