tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/tests/webpages/jsp servletPathInIncl.jsp
Date Sat, 09 Sep 2000 23:03:44 GMT
costin      00/09/09 16:03:43

  Added:       src/tests/webpages Inner.jsp Outer.jsp bufferoff.jsp
                        bufferon.jsp incl01.jsp incl02.jsp
                        servletPathInInclP.jsp snoop.jsp
               src/tests/webpages/WEB-INF/classes InclTest.java
                        Include.java
               src/tests/webpages/jsp servletPathInIncl.jsp
  Removed:     src/tests/share/tests/perf CounterClient.java
  Log:
  - added few classes/jsps used to fix various bugs. I have no driver, but
  I think it's better to have them checked in.
  
  - removed unused code
  
  Revision  Changes    Path
  1.1                  jakarta-tomcat/src/tests/webpages/Inner.jsp
  
  Index: Inner.jsp
  ===================================================================
  This is an inner file included via <jsp:include>.
  
  
  1.1                  jakarta-tomcat/src/tests/webpages/Outer.jsp
  
  Index: Outer.jsp
  ===================================================================
  <html>
  <head>
  <title>Include test</title>
  </head>
  <body>
  This is a test of forwarding and inclusion.  For some reason, it's not
  working right for us with Tomcat.
  
  <p>
  <jsp:include page="Inner.jsp" flush="true" />
  </body>
  </html>
  
  
  
  1.1                  jakarta-tomcat/src/tests/webpages/bufferoff.jsp
  
  Index: bufferoff.jsp
  ===================================================================
  <%@ page session="false" buffer="none" %>
  
  ====================================================================================================
  ====================================================================================================
  ====================================================================================================
  ====================================================================================================
  ====================================================================================================
  
  Hello
  
  
  1.1                  jakarta-tomcat/src/tests/webpages/bufferon.jsp
  
  Index: bufferon.jsp
  ===================================================================
  <%@ page session="false" %>
  
  ====================================================================================================
  ====================================================================================================
  ====================================================================================================
  ====================================================================================================
  ====================================================================================================
  
  Hello
  
  
  1.1                  jakarta-tomcat/src/tests/webpages/incl01.jsp
  
  Index: incl01.jsp
  ===================================================================
  <pre>
  incl01.jsp
  <%= new java.util.Date() %>
  <%= request.getParameter("abc") %>
  <jsp:include page="incl02.jsp" flush="true" />
  <jsp:include page="incl02.jsp?abc=ghi" flush="true" />
  <jsp:include page="incl02.jsp?abc=ghi&abc=jkl" flush="true" />
  <jsp:include page="incl02.jsp" flush="true" >
    <jsp:param name="abc" value="jkl" />
  </jsp:include>
  <jsp:include page="incl02.jsp" flush="true" >
    <jsp:param name="abc" value="jkl" />
    <jsp:param name="abc" value="mno" />
  </jsp:include>
  <jsp:include page="incl02.jsp" flush="true" />
  </pre>
  
  
  
  1.1                  jakarta-tomcat/src/tests/webpages/incl02.jsp
  
  Index: incl02.jsp
  ===================================================================
  incl02.jsp
  <%= request.getParameter("abc") %>
  <%
    String s[]=request.getParameterValues("abc");
    if (s!=null)
      for (int i=0; i<s.length; i++)
      {
        out.println(i+"="+s[i]);
      }
  %>
  
  
  1.1                  jakarta-tomcat/src/tests/webpages/servletPathInInclP.jsp
  
  Index: servletPathInInclP.jsp
  ===================================================================
  <pre>
  ServletPath=<%= request.getServletPath() %>
  </pre>
  <jsp:include page="jsp/servletPathInIncl.jsp" flush="true" />
  
  
  
  1.1                  jakarta-tomcat/src/tests/webpages/snoop.jsp
  
  Index: snoop.jsp
  ===================================================================
  <html>
  <!--
    Copyright (c) 1999 The Apache Software Foundation.  All rights 
    reserved.
  -->
  
  <body bgcolor="white">
  <h1> Request Information </h1>
  <font size="4">
  JSP Request Method: <%= request.getMethod() %>
  <br>
  Request URI: <%= request.getRequestURI() %>
  <br>
  Request Protocol: <%= request.getProtocol() %>
  <br>
  Servlet path: <%= request.getServletPath() %>
  <br>
  Path info: <%= request.getPathInfo() %>
  <br>
  Path translated: <%= request.getPathTranslated() %>
  <br>
  Query string: <%= request.getQueryString() %>
  <br>
  Content length: <%= request.getContentLength() %>
  <br>
  Content type: <%= request.getContentType() %>
  <br>
  Server name: <%= request.getServerName() %>
  <br>
  Server port: <%= request.getServerPort() %>
  <br>
  Remote user: <%= request.getRemoteUser() %>
  <br>
  Remote address: <%= request.getRemoteAddr() %>
  <br>
  Remote host: <%= request.getRemoteHost() %>
  <br>
  Authorization scheme: <%= request.getAuthType() %> 
  <hr>
  The browser you are using is <%= request.getHeader("User-Agent") %>
  <br>Init Param: <%= getServletConfig().getInitParameter( "test" ) %>
  <hr>
  </font>
  </body>
  </html>
  
  
  
  1.1                  jakarta-tomcat/src/tests/webpages/WEB-INF/classes/InclTest.java
  
  Index: InclTest.java
  ===================================================================
  import java.io.IOException;
  import javax.servlet.*;
  import javax.servlet.http.*;
  
  /**
   *  Simplest possible test of problem configuration:
   *  servlet forwards request to JSP, JSP includes another.
   */
  public class InclTest
      extends HttpServlet
  {
      public void doGet(HttpServletRequest request,
                        HttpServletResponse response)
          throws ServletException, IOException
      {
          RequestDispatcher rd =
   	    this.getServletContext().getRequestDispatcher("/Outer.jsp");
          rd.forward(request, response);
      }
  }
  
  
  
  
  1.1                  jakarta-tomcat/src/tests/webpages/WEB-INF/classes/Include.java
  
  Index: Include.java
  ===================================================================
  import javax.servlet.*;
  import javax.servlet.http.*;
  import java.io.*;
  
  public class Include extends HttpServlet {
  
      public void init(ServletConfig conf)
          throws ServletException
      {
          super.init(conf);
      }
  
      public void service(HttpServletRequest req, HttpServletResponse res)
          throws ServletException, IOException
      {
          res.setContentType("text/plain");
          PrintWriter out = res.getWriter();
  	
  	out.println("Before include");
  	RequestDispatcher rd=getServletContext().getRequestDispatcher("/realPath.jsp");
  	rd.include( req, res );
  	out.println("After include ");
          out.close();
      }
  }
  
  
  
  
  1.1                  jakarta-tomcat/src/tests/webpages/jsp/servletPathInIncl.jsp
  
  Index: servletPathInIncl.jsp
  ===================================================================
  <pre>
  ServletPath=<%= request.getServletPath() %>
  Attribute = <%= request.getAttribute("javax.servlet.include.servlet_path") %>
  
  </pre>
  
  
  

Mime
View raw message