-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #4430 Quickstart duplicate servlets,filters,listeners from cont…
…ext xml Signed-off-by: Jan Bartel <[email protected]>
- Loading branch information
Showing
4 changed files
with
222 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
jetty-quickstart/src/test/java/org/eclipse/jetty/quickstart/FooFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// | ||
// ======================================================================== | ||
// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others. | ||
// | ||
// This program and the accompanying materials are made available under | ||
// the terms of the Eclipse Public License 2.0 which is available at | ||
// https://www.eclipse.org/legal/epl-2.0 | ||
// | ||
// This Source Code may also be made available under the following | ||
// Secondary Licenses when the conditions for such availability set | ||
// forth in the Eclipse Public License, v. 2.0 are satisfied: | ||
// the Apache License v2.0 which is available at | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
// ======================================================================== | ||
// | ||
|
||
package org.eclipse.jetty.quickstart; | ||
|
||
import java.io.IOException; | ||
import javax.servlet.Filter; | ||
import javax.servlet.FilterChain; | ||
import javax.servlet.FilterConfig; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.ServletRequest; | ||
import javax.servlet.ServletResponse; | ||
|
||
public class FooFilter implements Filter | ||
{ | ||
@Override | ||
public void init(FilterConfig filterConfig) throws ServletException | ||
{ | ||
} | ||
|
||
@Override | ||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) | ||
throws IOException, ServletException | ||
{ | ||
chain.doFilter(request, response); | ||
} | ||
|
||
@Override | ||
public void destroy() | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd"> | ||
|
||
<!-- ================================================================== | ||
Configure and deploy the test web application in $(jetty.home)/webapps/test | ||
Note. If this file did not exist or used a context path other that /test | ||
then the default configuration of jetty.xml would discover the test | ||
webapplication with a WebAppDeployer. By specifying a context in this | ||
directory, additional configuration may be specified and hot deployments | ||
detected. | ||
===================================================================== --> | ||
|
||
<Configure id="testWebapp" class="org.eclipse.jetty.webapp.WebAppContext"> | ||
|
||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> | ||
<!-- Required minimal context configuration : --> | ||
<!-- + contextPath --> | ||
<!-- + war OR resourceBase --> | ||
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> | ||
<Set name="contextPath">/test</Set> | ||
|
||
<Get name="servletHandler"> | ||
<Call name="addServletWithMapping"> | ||
<Arg> | ||
<New class="org.eclipse.jetty.servlet.ServletHolder"> | ||
<Set name="name">FooServlet</Set> | ||
<Set name="className">org.eclipse.jetty.quickstart.FooServlet</Set> | ||
</New> | ||
</Arg> | ||
<Arg>/outer/*</Arg> | ||
</Call> | ||
|
||
<Call name="addFilterWithMapping"> | ||
<Arg> | ||
<New class="org.eclipse.jetty.servlet.FilterHolder"> | ||
<Set name="className">org.eclipse.jetty.quickstart.FooFilter</Set> | ||
<Set name="name">OuterFilter</Set> | ||
</New> | ||
</Arg> | ||
<Arg>/outer/*</Arg> | ||
<Arg type="java.lang.Integer">0</Arg> | ||
</Call> | ||
|
||
<Call name="addListener"> | ||
<Arg> | ||
<New class="org.eclipse.jetty.servlet.ListenerHolder"> | ||
<Set name="listener"> | ||
<New class="org.eclipse.jetty.quickstart.FooContextListener"></New> | ||
</Set> | ||
</New> | ||
</Arg> | ||
</Call> | ||
|
||
</Get> | ||
|
||
</Configure> |