You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by cr...@apache.org on 2001/12/21 20:15:38 UTC

cvs commit: jakarta-tomcat-4.0/tester/web Include03c.jsp

craigmcc    01/12/21 11:15:38

  Modified:    tester/src/bin tester.xml
  Added:       tester/web Include03c.jsp
  Log:
  Add "JSP->Servlet" and "JSP->JSP" cases for ensuring that a request attribute
  set by the included resource is visible to the including resource.  Previously we were only checking "Servlet->Servlet" and "Servlet->JSP".
  
  Revision  Changes    Path
  1.81      +8 -0      jakarta-tomcat-4.0/tester/src/bin/tester.xml
  
  Index: tester.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/tester/src/bin/tester.xml,v
  retrieving revision 1.80
  retrieving revision 1.81
  diff -u -r1.80 -r1.81
  --- tester.xml	2001/12/20 12:37:02	1.80
  +++ tester.xml	2001/12/21 19:15:38	1.81
  @@ -939,6 +939,14 @@
            request="${context.path}/WrappedInclude03?path=/Include03b.jsp"
         outContent="Include03 PASSED" debug="${debug}"/>
   
  +    <tester host="${host}" port="${port}" protocol="${protocol}"
  +         request="${context.path}/Include03c.jsp?path=/Include03a"
  +      outContent="Include03c.jsp PASSED" debug="${debug}"/>
  +
  +    <tester host="${host}" port="${port}" protocol="${protocol}"
  +         request="${context.path}/Include03c.jsp?path=/Include03b.jsp"
  +      outContent="Include03c.jsp PASSED" debug="${debug}"/>
  +
       <echo message="----- Include Then Forward -----"/>
   
       <tester host="${host}" port="${port}" protocol="${protocol}"
  
  
  
  1.1                  jakarta-tomcat-4.0/tester/web/Include03c.jsp
  
  Index: Include03c.jsp
  ===================================================================
  <%@ page contentType="text/plain" %><%
    // Duplicate logic from "Include03.java"
    StringBuffer sb = new StringBuffer();
    String path = request.getParameter("path");
    if (path == null)
      path = "/Include03a";
    RequestDispatcher rd =
      getServletContext().getRequestDispatcher(path);
    if (rd == null) {
      sb.append(" No RequestDispatcher returned/");
    } else {
      rd.include(request, response);
    }
    response.resetBuffer();
    String value = null;
    try {
      value = (String) request.getAttribute(path.substring(1));
    } catch (ClassCastException e) {
        sb.append(" Returned attribute not of type String/");
    }
    if ((sb.length() < 1) && (value == null)) {
        sb.append(" No includee-created attribute was returned/");
    }
    if (sb.length() < 1)
      out.println("Include03c.jsp PASSED");
    else {
      out.print("Include03c.jsp FAILED -");
      out.println(sb.toString());
    }
  %>
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>