diff --git a/tests/test-webapps/test-dispatch-webapp/pom.xml b/tests/test-webapps/test-dispatch-webapp/pom.xml deleted file mode 100644 index 5afe024043c..00000000000 --- a/tests/test-webapps/test-dispatch-webapp/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - 4.0.0 - - org.eclipse.jetty.tests - test-webapps-parent - 9.3.0-SNAPSHOT - - Jetty Tests :: Webapps :: Dispatch Webapp - test-dispatch-webapp - war - - ${project.groupId}.dispatch - - - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - org.eclipse.jetty - jetty-maven-plugin - ${project.version} - - 1 - true - - src/main/webapp - src/main/webapp/WEB-INF/web.xml - /test-dispatch - .*/javax.servlet-[^/]*\.jar$ - true - - - - - - - - javax.servlet - javax.servlet-api - provided - - - diff --git a/tests/test-webapps/test-dispatch-webapp/src/main/java/com/acme/DispatchServlet.java b/tests/test-webapps/test-dispatch-webapp/src/main/java/com/acme/DispatchServlet.java deleted file mode 100644 index 257780be849..00000000000 --- a/tests/test-webapps/test-dispatch-webapp/src/main/java/com/acme/DispatchServlet.java +++ /dev/null @@ -1,123 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2018 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// All rights reserved. This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v1.0 -// and Apache License v2.0 which accompanies this distribution. -// -// The Eclipse Public License is available at -// http://www.eclipse.org/legal/epl-v10.html -// -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== -// - -package com.acme; - -import static javax.servlet.RequestDispatcher.FORWARD_PATH_INFO; -import static javax.servlet.RequestDispatcher.FORWARD_QUERY_STRING; -import static javax.servlet.RequestDispatcher.FORWARD_SERVLET_PATH; -import static javax.servlet.RequestDispatcher.INCLUDE_PATH_INFO; -import static javax.servlet.RequestDispatcher.INCLUDE_QUERY_STRING; -import static javax.servlet.RequestDispatcher.INCLUDE_REQUEST_URI; -import static javax.servlet.RequestDispatcher.INCLUDE_SERVLET_PATH; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - - -public class DispatchServlet extends HttpServlet -{ - - @Override - protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException - { - doGet(req, resp); - } - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - Integer depth = (Integer)request.getAttribute("depth"); - if (depth==null) - depth=1; - else - depth=depth+1; - request.setAttribute("depth", depth); - - String path=request.getServletPath(); - String info=request.getPathInfo(); - String query=request.getQueryString(); - - boolean include=request.getAttribute(INCLUDE_REQUEST_URI)!=null; - - String tpath = include?(String)request.getAttribute(INCLUDE_SERVLET_PATH):path; - String tinfo = include?(String)request.getAttribute(INCLUDE_PATH_INFO):info; - - if ("/forward".equals(tpath)) - { - getServletContext().getRequestDispatcher(tinfo+"?depth="+depth+"&p"+depth+"="+"ABCDEFGHI".charAt(depth)).forward(request, response); - } - else if ("/include".equals(tpath)) - { - response.setContentType("text/html"); - PrintWriter out = response.getWriter(); - out.println("

Dispatch Depth="+depth+"

");
-            out.printf("            %30s%30s%30s%n","REQUEST","FORWARD","INCLUDE");
-            out.printf("servletPath:%30s%30s%30s%n",path,request.getAttribute(FORWARD_SERVLET_PATH),request.getAttribute(INCLUDE_SERVLET_PATH));
-            out.printf("   pathInfo:%30s%30s%30s%n",info,request.getAttribute(FORWARD_PATH_INFO),request.getAttribute(INCLUDE_PATH_INFO));
-            out.printf("      query:%30s%30s%30s%n",query,request.getAttribute(FORWARD_QUERY_STRING),request.getAttribute(INCLUDE_QUERY_STRING));
-            out.println();
-            printParameters(out, request.getParameterMap());
-            out.println("
"); - out.println("
"); - getServletContext().getRequestDispatcher(tinfo+"?depth="+depth+"&p"+depth+"="+"BCDEFGHI".charAt(depth)).include(request, response); - out.println("
"); - out.println("

Dispatch Depth="+depth+"

");
-            out.printf("            %30s%30s%30s%n","REQUEST","FORWARD","INCLUDE");
-            out.printf("servletPath:%30s%30s%30s%n",path,request.getAttribute(FORWARD_SERVLET_PATH),request.getAttribute(INCLUDE_SERVLET_PATH));
-            out.printf("   pathInfo:%30s%30s%30s%n",info,request.getAttribute(FORWARD_PATH_INFO),request.getAttribute(INCLUDE_PATH_INFO));
-            out.printf("      query:%30s%30s%30s%n",query,request.getAttribute(FORWARD_QUERY_STRING),request.getAttribute(INCLUDE_QUERY_STRING));
-            out.println();
-            printParameters(out, request.getParameterMap());
-            out.println("
"); - } - else - { - response.setContentType("text/html"); - PrintWriter out = response.getWriter(); - out.println("

Dispatch Depth="+depth+"

");
-            out.printf("            %30s%30s%30s%n","REQUEST","FORWARD","INCLUDE");
-            out.printf("servletPath:%30s%30s%30s%n",path,request.getAttribute(FORWARD_SERVLET_PATH),request.getAttribute(INCLUDE_SERVLET_PATH));
-            out.printf("   pathInfo:%30s%30s%30s%n",info,request.getAttribute(FORWARD_PATH_INFO),request.getAttribute(INCLUDE_PATH_INFO));
-            out.printf("      query:%30s%30s%30s%n",query,request.getAttribute(FORWARD_QUERY_STRING),request.getAttribute(INCLUDE_QUERY_STRING));
-            out.println();
-            printParameters(out, request.getParameterMap());
-            out.println("
"); - } - } - - private static void printParameters(PrintWriter out, Map params) - { - List names = new ArrayList<>(params.keySet()); - Collections.sort(names); - - for (String name: names) - out.printf("%10s : %s%n", name,Arrays.asList(params.get(name))); - } - -} diff --git a/tests/test-webapps/test-dispatch-webapp/src/main/webapp/WEB-INF/web.xml b/tests/test-webapps/test-dispatch-webapp/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 77c8f0c19fb..00000000000 --- a/tests/test-webapps/test-dispatch-webapp/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - Test Dispatch WebApp - - - Dispatch - com.acme.DispatchServlet - 2 - - - - Dispatch - /forward/* - /include/* - /info/* - - - diff --git a/tests/test-webapps/test-dispatch-webapp/src/main/webapp/images/jetty_banner.gif b/tests/test-webapps/test-dispatch-webapp/src/main/webapp/images/jetty_banner.gif deleted file mode 100644 index 0a9b1e019ba..00000000000 Binary files a/tests/test-webapps/test-dispatch-webapp/src/main/webapp/images/jetty_banner.gif and /dev/null differ diff --git a/tests/test-webapps/test-dispatch-webapp/src/main/webapp/images/small_powered_by.gif b/tests/test-webapps/test-dispatch-webapp/src/main/webapp/images/small_powered_by.gif deleted file mode 100644 index c5dd44319f0..00000000000 Binary files a/tests/test-webapps/test-dispatch-webapp/src/main/webapp/images/small_powered_by.gif and /dev/null differ diff --git a/tests/test-webapps/test-dispatch-webapp/src/main/webapp/index.html b/tests/test-webapps/test-dispatch-webapp/src/main/webapp/index.html deleted file mode 100644 index ae423fccbf0..00000000000 --- a/tests/test-webapps/test-dispatch-webapp/src/main/webapp/index.html +++ /dev/null @@ -1,48 +0,0 @@ - - - Test Dispatch WebApp - - - - - - - -

Request Dispatching Query Tests

-

-

-

Request Dispatching Form POST Tests

-

-

-

Request Dispatching Query Form POST Tests

-

-

- -
-
- -
- - - diff --git a/tests/test-webapps/test-dispatch-webapp/src/main/webapp/stylesheet.css b/tests/test-webapps/test-dispatch-webapp/src/main/webapp/stylesheet.css deleted file mode 100644 index f90463dd2c9..00000000000 --- a/tests/test-webapps/test-dispatch-webapp/src/main/webapp/stylesheet.css +++ /dev/null @@ -1,7 +0,0 @@ -body {color: #2E2E2E; font-family:sans-serif; font-size:90%;} -h1 {font-variant: small-caps; font-size:130%; letter-spacing: 0.1em;} -h2 {font-variant: small-caps; font-size:100%; letter-spacing: 0.1em; margin-top:2em;} -h3 {font-size:100%; letter-spacing: 0.1em;} - -span.pass { color: green; } -span.fail { color:red; }