This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 0d6c7a0c8d Make URL and URL-pattern decoding configurable.
0d6c7a0c8d is described below
commit 0d6c7a0c8d92971f4b8f6973a3cf96e44a5bc908
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Aug 10 20:44:10 2026 +0100
Make URL and URL-pattern decoding configurable.
The Servlet specification states URLs and URL patterns should always be
specified in URL-decoded form. However, the Tomcat commit logs from the
time (more than quarter of a century ago) suggests the exact opposite
was intended:
https://lists.apache.org/thread/fzcq06b7dl8w3q8j1jhvq9cmbsq5f2f3
This commit does not change the default behaviour of URL-decoding URLs
and URL patterns (it will change for 12.0.x once this change has been
back-ported).
In the unlikely event an application needs to specify a URL or URL
pattern that needs to be URL-decoded, the configuration options allows
the application to migrate when they are ready.
---
java/org/apache/catalina/Context.java | 80 ++++++++++++++++-
.../core/ApplicationFilterRegistration.java | 9 +-
.../core/ApplicationServletRegistration.java | 9 +-
java/org/apache/catalina/core/StandardContext.java | 34 ++++++-
.../org/apache/catalina/startup/ContextConfig.java | 22 +++--
.../org/apache/catalina/startup/FailedContext.java | 6 ++
java/org/apache/catalina/startup/Tomcat.java | 6 +-
.../tomcat/util/descriptor/web/ErrorPage.java | 4 +
.../tomcat/util/descriptor/web/FilterMap.java | 4 +
.../descriptor/web/FragmentJarScannerCallback.java | 6 +-
.../util/descriptor/web/JspPropertyGroup.java | 3 +
.../tomcat/util/descriptor/web/LoginConfig.java | 7 ++
.../util/descriptor/web/SecurityCollection.java | 4 +
.../util/descriptor/web/SecurityConstraint.java | 1 +
.../tomcat/util/descriptor/web/WebRuleSet.java | 61 +++++++++++--
.../apache/tomcat/util/descriptor/web/WebXml.java | 65 +++++++++++---
.../tomcat/util/descriptor/web/WebXmlParser.java | 47 ++++++++--
.../util/descriptor/web/XmlEncodingBase.java | 11 ++-
.../servlet/annotation/TestServletSecurity.java | 4 +-
.../servlet/http/HttpServletDoHeadBaseTest.java | 4 +-
test/javax/servlet/http/TestHttpServlet.java | 14 +--
.../http/TestHttpServletResponseSendError.java | 8 +-
.../authenticator/TestAuthInfoResponseHeaders.java | 4 +-
.../TestAuthenticatorBaseCorsPreflight.java | 6 +-
.../authenticator/TestDigestAuthenticator.java | 4 +-
.../TestDigestAuthenticatorAlgorithms.java | 4 +-
.../authenticator/TestDigestAuthenticatorB.java | 4 +-
.../authenticator/TestFormAuthenticatorA.java | 6 +-
.../TestNonLoginAndBasicAuthenticator.java | 16 ++--
.../authenticator/TestSSOChangeSessionId.java | 8 +-
.../TestSSOnonLoginAndBasicAuthenticator.java | 16 ++--
.../TestSSOnonLoginAndDigestAuthenticator.java | 12 +--
.../catalina/connector/TestClientReadTimeout.java | 2 +-
.../apache/catalina/connector/TestConnector.java | 6 +-
.../catalina/connector/TestCoyoteAdapter.java | 10 +--
.../connector/TestCoyoteAdapterRequestFuzzing.java | 2 +-
.../catalina/connector/TestCoyoteInputStream.java | 2 +-
.../catalina/connector/TestCoyoteOutputStream.java | 6 +-
.../apache/catalina/connector/TestInputBuffer.java | 6 +-
.../catalina/connector/TestKeepAliveCount.java | 2 +-
.../catalina/connector/TestMaxConnections.java | 2 +-
.../catalina/connector/TestOutputBuffer.java | 6 +-
.../org/apache/catalina/connector/TestRequest.java | 20 ++---
.../apache/catalina/connector/TestResponse.java | 8 +-
.../apache/catalina/connector/TestSendFile.java | 4 +-
.../connector/TestValidateClientSessionId.java | 6 +-
.../catalina/core/TestApplicationContext.java | 6 +-
...TestApplicationContextGetRequestDispatcher.java | 6 +-
...estApplicationContextGetRequestDispatcherB.java | 4 +-
...estApplicationContextGetRequestDispatcherC.java | 4 +-
.../catalina/core/TestApplicationFilterConfig.java | 2 +-
.../catalina/core/TestApplicationHttpRequest.java | 8 +-
.../catalina/core/TestApplicationMapping.java | 22 ++---
.../apache/catalina/core/TestAsyncContextImpl.java | 100 ++++++++++-----------
.../core/TestAsyncContextImplDispatch.java | 4 +-
.../TestAsyncContextImplListenerOnComplete.java | 2 +-
.../catalina/core/TestAsyncContextIoError.java | 4 +-
.../core/TestAsyncContextStateChanges.java | 2 +-
.../core/TestPropertiesRoleMappingListener.java | 2 +-
.../apache/catalina/core/TestStandardContext.java | 8 +-
.../catalina/core/TestStandardContextAliases.java | 2 +-
.../core/TestStandardContextResources.java | 6 +-
.../catalina/core/TestStandardContextValve.java | 8 +-
.../catalina/core/TestStandardHostValve.java | 10 +--
.../apache/catalina/core/TestStandardWrapper.java | 4 +-
.../catalina/core/TestSwallowAbortedUploads.java | 4 +-
.../catalina/filters/TestAddCharSetFilter.java | 2 +-
.../apache/catalina/filters/TestExpiresFilter.java | 8 +-
.../catalina/filters/TestRateLimitFilter.java | 2 +-
.../TestRateLimitFilterWithExactRateLimiter.java | 2 +-
.../catalina/filters/TestRemoteCIDRFilter.java | 2 +-
.../catalina/filters/TestRemoteIpFilter.java | 10 +--
.../filters/TestRestCsrfPreventionFilter2.java | 6 +-
.../catalina/ha/context/TestReplicatedContext.java | 2 +-
.../TestWebappClassLoaderExecutorMemoryLeak.java | 2 +-
.../loader/TestWebappClassLoaderMemoryLeak.java | 2 +-
...sterWebappClassLoaderThreadLocalMemoryLeak.java | 4 +-
.../catalina/manager/TestHostManagerWebapp.java | 2 +-
.../apache/catalina/manager/TestManagerWebapp.java | 2 +-
.../catalina/manager/TestStatusTransformer.java | 6 +-
.../apache/catalina/mapper/TestMapperWebapps.java | 6 +-
.../catalina/nonblocking/TestNonBlockingAPI.java | 20 ++---
test/org/apache/catalina/realm/TestRealmBase.java | 10 +--
.../servlets/DefaultServletEncodingBaseTest.java | 4 +-
.../catalina/servlets/ServletOptionsBaseTest.java | 2 +-
.../catalina/servlets/TestDefaultServlet.java | 24 ++---
.../TestDefaultServletIfMatchRequests.java | 2 +-
.../catalina/servlets/TestDefaultServletPut.java | 2 +-
.../servlets/TestDefaultServletRangeRequests.java | 2 +-
.../TestDefaultServletRfc9110Section13.java | 2 +-
.../TestDefaultServletRfc9110Section14.java | 4 +-
.../catalina/servlets/TestWebdavServlet.java | 22 ++---
.../session/TestPersistentManagerIntegration.java | 6 +-
.../session/TestStandardSessionIntegration.java | 2 +-
.../org/apache/catalina/ssi/TestRegExpCapture.java | 2 +-
test/org/apache/catalina/ssi/TestSsiServlet.java | 4 +-
.../apache/catalina/startup/EmbeddedTomcat.java | 2 +-
.../apache/catalina/startup/TestContextConfig.java | 4 +-
.../startup/TestContextConfigAnnotation.java | 2 +-
.../catalina/startup/TestPropertySources.java | 2 +-
.../startup/TestStartupIPv6Connectors.java | 2 +-
test/org/apache/catalina/startup/TestTomcat.java | 12 +--
.../catalina/startup/TestTomcatClassLoader.java | 4 +-
.../catalina/startup/TestTomcatStandalone.java | 2 +-
.../apache/catalina/valves/TestAccessLogValve.java | 2 +-
.../catalina/valves/TestAccessLogValveFile.java | 2 +-
.../catalina/valves/TestErrorReportValve.java | 14 +--
.../valves/TestExtendedAccessLogValve.java | 2 +-
.../catalina/valves/TestJsonErrorReportValve.java | 24 ++---
.../catalina/valves/TestParameterLimitValve.java | 36 ++++----
.../catalina/valves/TestPersistentValveAsync.java | 10 +--
.../catalina/valves/TestProxyErrorReportValve.java | 24 ++---
.../apache/catalina/valves/TestSemaphoreValve.java | 16 ++--
.../catalina/valves/rewrite/TestRewriteValve.java | 20 ++---
.../webresources/TestWebResourceContentType.java | 2 +-
test/org/apache/coyote/TestAbstractProtocol.java | 2 +-
test/org/apache/coyote/TestIoTimeouts.java | 2 +-
test/org/apache/coyote/TestResponse.java | 4 +-
.../coyote/ajp/TestAbstractAjpProcessor.java | 16 ++--
.../coyote/http11/TestHttp11InputBuffer.java | 10 +--
.../coyote/http11/TestHttp11InputBufferCRLF.java | 2 +-
.../coyote/http11/TestHttp11OutputBuffer.java | 4 +-
.../apache/coyote/http11/TestHttp11Processor.java | 70 +++++++--------
.../coyote/http11/TestHttp11ProcessorDoHead.java | 2 +-
.../http11/filters/TestChunkedInputFilter.java | 26 +++---
.../apache/coyote/http11/upgrade/TestUpgrade.java | 2 +-
.../http11/upgrade/TestUpgradeInternalHandler.java | 2 +-
test/org/apache/coyote/http2/Http2TestBase.java | 10 +--
test/org/apache/coyote/http2/TestAsync.java | 4 +-
test/org/apache/coyote/http2/TestAsyncError.java | 4 +-
test/org/apache/coyote/http2/TestAsyncFlush.java | 4 +-
.../apache/coyote/http2/TestAsyncReadListener.java | 4 +-
test/org/apache/coyote/http2/TestAsyncTimeout.java | 4 +-
.../apache/coyote/http2/TestCancelledUpload.java | 2 +-
.../apache/coyote/http2/TestHttp2AccessLogs.java | 4 +-
.../coyote/http2/TestHttp2UpgradeHandler.java | 8 +-
test/org/apache/coyote/http2/TestLargeUpload.java | 2 +-
.../http2/TestStandardSessionIntegrationHttp2.java | 4 +-
test/org/apache/coyote/http2/TestStream.java | 8 +-
.../apache/coyote/http2/TestStreamProcessor.java | 44 ++++-----
.../apache/coyote/http2/TestStreamQueryString.java | 2 +-
.../apache/jasper/runtime/TestPageContextImpl.java | 2 +-
test/org/apache/jasper/servlet/TestJspServlet.java | 2 +-
.../apache/juli/TestPerWebappJuliIntegration.java | 4 +-
test/org/apache/naming/TestEnvEntry.java | 2 +-
.../apache/naming/resources/TestNamingContext.java | 10 +--
.../httpd/HttpdIntegrationBaseTest.java | 2 +-
.../integration/httpd/TestErrorHandling.java | 2 +-
.../tomcat/security/TestSecurity2017Ocsp.java | 2 +-
.../apache/tomcat/security/TestSecurity2018.java | 2 +-
.../apache/tomcat/security/TestSecurity2019.java | 8 +-
.../apache/tomcat/security/TestSecurity2023.java | 8 +-
test/org/apache/tomcat/unittest/TesterContext.java | 7 ++
.../web/TestJspPropertyGroupDescriptorImpl.java | 2 +-
.../descriptor/web/TestSecurityConstraint.java | 8 +-
.../tomcat/util/descriptor/web/TestWebXml.java | 5 +-
.../apache/tomcat/util/http/TestCookieParsing.java | 2 +-
.../http/TestCookieProcessorGenerationHttp.java | 4 +-
.../util/http/TestMimeHeadersIntegration.java | 2 +-
.../apache/tomcat/util/net/TestAlpnFallback.java | 2 +-
.../tomcat/util/net/TestLargeClientHello.java | 2 +-
test/org/apache/tomcat/util/net/TestPQC.java | 2 +-
.../tomcat/util/net/TestSSLHostConfigCipher.java | 2 +-
.../tomcat/util/net/TestSSLHostConfigCompat.java | 2 +-
.../tomcat/util/net/TestSSLHostConfigProtocol.java | 4 +-
test/org/apache/tomcat/util/net/TestSsl.java | 6 +-
.../tomcat/util/net/TestSslHandshakeFailure.java | 2 +-
test/org/apache/tomcat/util/net/TesterSupport.java | 6 +-
.../apache/tomcat/util/net/ocsp/OcspBaseTest.java | 2 +-
.../tomcat/util/net/ocsp/TesterOcspResponder.java | 2 +-
.../tomcat/websocket/TestWebSocketFrameClient.java | 14 +--
.../websocket/TestWebSocketFrameClientSSL.java | 4 +-
.../tomcat/websocket/TestWsPingPongMessages.java | 2 +-
.../tomcat/websocket/TestWsRemoteEndpoint.java | 4 +-
.../websocket/TestWsSessionSuspendResume.java | 4 +-
.../tomcat/websocket/TestWsSubprotocols.java | 2 +-
.../tomcat/websocket/TestWsWebSocketContainer.java | 14 +--
.../TestWsWebSocketContainerGetOpenSessions.java | 2 +-
.../websocket/TestWsWebSocketContainerSSL.java | 2 +-
...ocketContainerSessionExpiryContainerClient.java | 2 +-
...ocketContainerSessionExpiryContainerServer.java | 2 +-
...stWsWebSocketContainerSessionExpirySession.java | 2 +-
.../TestWsWebSocketContainerTimeoutClient.java | 2 +-
.../TestWsWebSocketContainerTimeoutServer.java | 2 +-
.../TesterConnectionLimitPerformance.java | 2 +-
.../websocket/TesterWebSocketClientProxy.java | 4 +-
.../apache/tomcat/websocket/WebSocketBaseTest.java | 2 +-
.../websocket/pojo/TestEncodingDecoding.java | 12 +--
.../websocket/pojo/TestPojoEndpointBase.java | 4 +-
.../websocket/pojo/TestPojoMethodMapping.java | 2 +-
.../server/TestAsyncMessagesPerformance.java | 2 +-
.../tomcat/websocket/server/TestClassLoader.java | 2 +-
.../tomcat/websocket/server/TestCloseBug58624.java | 2 +-
.../tomcat/websocket/server/TestShutdown.java | 2 +-
.../tomcat/websocket/server/TestSlowClient.java | 2 +-
.../TestWsRemoteEndpointImplServerDeadlock.java | 2 +-
.../websocket/server/TestWsServerContainer.java | 4 +-
.../server/TesterWsRemoteEndpointImplServer.java | 2 +-
webapps/docs/changelog.xml | 14 +++
webapps/docs/config/context.xml | 16 ++++
200 files changed, 967 insertions(+), 644 deletions(-)
diff --git a/java/org/apache/catalina/Context.java b/java/org/apache/catalina/Context.java
index 686f5e480a..e639fe0f91 100644
--- a/java/org/apache/catalina/Context.java
+++ b/java/org/apache/catalina/Context.java
@@ -873,10 +873,45 @@ public interface Context extends Container, ContextBind {
/**
* Add a new servlet mapping, replacing any existing mapping for the specified pattern.
+ * <p>
+ * No URL-decoding of the pattern will be performed.
+ *
+ * @param pattern URL pattern to be mapped
+ * @param name Name of the corresponding servlet to execute
+ */
+ default void addServletMapping(String pattern, String name) {
+ addServletMapping(pattern, name, false);
+ }
+
+
+ /**
+ * Add a new servlet mapping, replacing any existing mapping for the specified pattern.
+ * <p>
+ * No URL-decoding of the pattern will be performed.
+ * <p>
+ * Implementation Note: As of Tomcat 12 this default implementation will be removed. Implementors are encouraged to
+ * provide their own implementation of this method before then.
+ *
+ * @param pattern URL pattern to be mapped
+ * @param name Name of the corresponding servlet to execute
+ * @param jspWildcard true if name identifies the JspServlet and pattern contains a wildcard; false otherwise
+ */
+ default void addServletMapping(String pattern, String name, boolean jspWildcard) {
+ addServletMappingDecoded(pattern, name, jspWildcard);
+ }
+
+
+ /**
+ * Add a new servlet mapping, replacing any existing mapping for the specified pattern.
+ * <p>
+ * No URL-decoding of the pattern will be performed.
*
* @param pattern URL pattern to be mapped
* @param name Name of the corresponding servlet to execute
+ *
+ * @deprecated Will be removed in Tomcat 12 onwards.
*/
+ @Deprecated
default void addServletMappingDecoded(String pattern, String name) {
addServletMappingDecoded(pattern, name, false);
}
@@ -884,11 +919,21 @@ public interface Context extends Container, ContextBind {
/**
* Add a new servlet mapping, replacing any existing mapping for the specified pattern.
+ * <p>
+ * No URL-decoding of the pattern will be performed.
*
* @param pattern URL pattern to be mapped
* @param name Name of the corresponding servlet to execute
* @param jspWildcard true if name identifies the JspServlet and pattern contains a wildcard; false otherwise
+ *
+ * @deprecated This method will be removed in Tomcat 12. Implementors are expected to implement this method without
+ * delegating the implementation to one of the other {@code addServletMapping*} methods as that may
+ * trigger infinite loops. Once this method has been removed from the interface, implementors may
+ * wish to move their implementation of this method to
+ * {@link Context#addServletMapping(String, String, boolean)} and remove their implementation of
+ * this method.
*/
+ @Deprecated
void addServletMappingDecoded(String pattern, String name, boolean jspWildcard);
@@ -1183,8 +1228,7 @@ public interface Context extends Container, ContextBind {
/**
* Returns the array of welcome files defined for this Context.
*
- * @return the array of welcome files defined for this Context. If none are defined, a zero-length array is
- * returned
+ * @return the array of welcome files defined for this Context. If none are defined, a zero-length array is returned
*/
String[] findWelcomeFiles();
@@ -1989,4 +2033,36 @@ public interface Context extends Container, ContextBind {
default EncodedSolidusHandling getEncodedSolidusHandlingEnum() {
return EncodedSolidusHandling.DECODE;
}
+
+
+ /**
+ * Configures whether the Context expects URLs and URL patterns provided in web.xml, annotations and their
+ * programmatic equivalents to be in URL-decoded form.
+ *
+ * @param urlPatternsProvidedInDecodedForm {@code true} if URLs and URL patterns are expected to be decoded.
+ * {@code false} if they are expected to be URL-encoded (i.e.
+ * {@code %nn} encoding)
+ *
+ * @deprecated This is a transitional setting that will be removed in Tomcat 12 where it will be hard-coded to
+ * {@code true}
+ */
+ @Deprecated
+ default void setUrlPatternsProvidedInDecodedForm(boolean urlPatternsProvidedInDecodedForm) {
+ throw new UnsupportedOperationException();
+ }
+
+
+ /**
+ * Does this Context expect URLs and URL patterns provided in web.xml, annotations and their programmatic
+ * equivalents to be in URL-decoded form?
+ *
+ * @return This default implementation returns {@code false}
+ *
+ * @deprecated This is a transitional setting that will be removed in Tomcat 12 where it will be hard-coded to
+ * {@code true}
+ */
+ @Deprecated
+ default boolean getUrlPatternsProvidedInDecodedForm() {
+ return false;
+ }
}
diff --git a/java/org/apache/catalina/core/ApplicationFilterRegistration.java b/java/org/apache/catalina/core/ApplicationFilterRegistration.java
index 38416f2b47..b9dd6395c5 100644
--- a/java/org/apache/catalina/core/ApplicationFilterRegistration.java
+++ b/java/org/apache/catalina/core/ApplicationFilterRegistration.java
@@ -89,6 +89,7 @@ public class ApplicationFilterRegistration implements FilterRegistration.Dynamic
}
}
+ @SuppressWarnings("deprecation")
@Override
public void addMappingForUrlPatterns(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter,
String... urlPatterns) {
@@ -108,8 +109,12 @@ public class ApplicationFilterRegistration implements FilterRegistration.Dynamic
if (urlPattern == null) {
throw new IllegalArgumentException(sm.getString("applicationFilterRegistration.nullUrlPattern"));
}
- // URL decoded using UTF-8 in addURLPattern
- filterMap.addURLPattern(urlPattern);
+ if (context.getUrlPatternsProvidedInDecodedForm()) {
+ filterMap.addURLPatternDecoded(urlPattern);
+ } else {
+ // % decoded (if required) using UTF-8
+ filterMap.addURLPattern(urlPattern);
+ }
}
if (isMatchAfter) {
diff --git a/java/org/apache/catalina/core/ApplicationServletRegistration.java b/java/org/apache/catalina/core/ApplicationServletRegistration.java
index 2e7e32e1f6..d7640f00a6 100644
--- a/java/org/apache/catalina/core/ApplicationServletRegistration.java
+++ b/java/org/apache/catalina/core/ApplicationServletRegistration.java
@@ -167,6 +167,7 @@ public class ApplicationServletRegistration implements ServletRegistration.Dynam
}
+ @SuppressWarnings("deprecation")
@Override
public Set<String> addMapping(String... urlPatterns) {
if (urlPatterns == null) {
@@ -178,7 +179,11 @@ public class ApplicationServletRegistration implements ServletRegistration.Dynam
if (urlPatterns[i] == null) {
throw new IllegalArgumentException(sm.getString("applicationServletRegistration.nullUrlPattern"));
}
- decodedUrlPatterns[i] = UDecoder.URLDecode(urlPatterns[i], StandardCharsets.UTF_8);
+ if (context.getUrlPatternsProvidedInDecodedForm()) {
+ decodedUrlPatterns[i] = urlPatterns[i];
+ } else {
+ decodedUrlPatterns[i] = UDecoder.URLDecode(urlPatterns[i], StandardCharsets.UTF_8);
+ }
}
Set<String> conflicts = new HashSet<>();
@@ -210,7 +215,7 @@ public class ApplicationServletRegistration implements ServletRegistration.Dynam
overrides.forEach(p -> context.removeServletMapping(p));
for (String urlPattern : decodedUrlPatterns) {
- context.addServletMappingDecoded(urlPattern, wrapper.getName());
+ context.addServletMapping(urlPattern, wrapper.getName());
}
if (constraint != null) {
diff --git a/java/org/apache/catalina/core/StandardContext.java b/java/org/apache/catalina/core/StandardContext.java
index 36dbf4a1d0..86083b447d 100644
--- a/java/org/apache/catalina/core/StandardContext.java
+++ b/java/org/apache/catalina/core/StandardContext.java
@@ -807,9 +807,29 @@ public class StandardContext extends ContainerBase implements Context, Notificat
private EncodedSolidusHandling encodedSolidusHandling = EncodedSolidusHandling.DECODE;
+ // Defaults to false for backwards compatibility but will be hard-coded to true for Tomcat 12 onwards.
+ private boolean urlPatternsProvidedInDecodedForm = false;
+
// ----------------------------------------------------- Context Properties
+ @Override
+ public void setUrlPatternsProvidedInDecodedForm(boolean urlPatternsProvidedInDecodedForm) {
+ this.urlPatternsProvidedInDecodedForm = urlPatternsProvidedInDecodedForm;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ *
+ * @return {@code true} if URLs and URL patterns are expected in URL-decoded form, otherwise {@code false}
+ */
+ @Override
+ public boolean getUrlPatternsProvidedInDecodedForm() {
+ return urlPatternsProvidedInDecodedForm;
+ }
+
+
@Override
public String getEncodedReverseSolidusHandling() {
return encodedReverseSolidusHandling.getValue();
@@ -1934,6 +1954,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat
}
+ @SuppressWarnings("deprecation")
@Override
public void setLoginConfig(LoginConfig config) {
@@ -1947,6 +1968,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat
if (log.isDebugEnabled()) {
log.debug(sm.getString("standardContext.loginConfig.loginWarning", loginPage));
}
+ // Use decoded variant to avoid double decoding
config.setLoginPageDecoded("/" + loginPage);
} else {
throw new IllegalArgumentException(sm.getString("standardContext.loginConfig.loginPage", loginPage));
@@ -1958,6 +1980,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat
if (log.isDebugEnabled()) {
log.debug(sm.getString("standardContext.loginConfig.errorWarning", errorPage));
}
+ // Use decoded variant to avoid double decoding
config.setErrorPageDecoded("/" + errorPage);
} else {
throw new IllegalArgumentException(sm.getString("standardContext.loginConfig.errorPage", errorPage));
@@ -2770,7 +2793,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat
*/
String[] jspMappings = oldJspServlet.findMappings();
for (int i = 0; jspMappings != null && i < jspMappings.length; i++) {
- addServletMappingDecoded(jspMappings[i], child.getName());
+ addServletMapping(jspMappings[i], child.getName());
}
}
}
@@ -2805,6 +2828,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat
}
+ @SuppressWarnings("deprecation")
@Override
public void addErrorPage(ErrorPage errorPage) {
// Validate the input parameters
@@ -2817,6 +2841,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat
if (log.isDebugEnabled()) {
log.debug(sm.getString("standardContext.errorPage.warning", location));
}
+ // Error page is already decoded, so don't decode a second time
errorPage.setLocationDecoded("/" + location);
} else {
throw new IllegalArgumentException(sm.getString("standardContext.errorPage.error", location));
@@ -2967,6 +2992,13 @@ public class StandardContext extends ContainerBase implements Context, Notificat
@Override
+ public void addServletMapping(String pattern, String name, boolean jspWildCard) {
+ addServletMappingDecoded(pattern, name, jspWildCard);
+ }
+
+
+ @Override
+ @Deprecated
public void addServletMappingDecoded(String pattern, String name, boolean jspWildCard) {
// Validate the proposed mapping
if (findChild(name) == null) {
diff --git a/java/org/apache/catalina/startup/ContextConfig.java b/java/org/apache/catalina/startup/ContextConfig.java
index 97942f9fad..7dae3d6d2f 100644
--- a/java/org/apache/catalina/startup/ContextConfig.java
+++ b/java/org/apache/catalina/startup/ContextConfig.java
@@ -1313,8 +1313,9 @@ public class ContextConfig implements LifecycleListener {
* - If an SCI has a @HandlesType annotation then all classes (except those in JARs excluded from an absolute
* ordering) need to be scanned to check if they match.
*/
+ @SuppressWarnings("deprecation")
WebXmlParser webXmlParser = new WebXmlParser(context.getXmlNamespaceAware(), context.getXmlValidation(),
- context.getXmlBlockExternal());
+ context.getXmlBlockExternal(), context.getUrlPatternsProvidedInDecodedForm());
Set<WebXml> defaults = new HashSet<>();
defaults.add(getDefaultWebXmlFragment(webXmlParser));
@@ -1595,7 +1596,7 @@ public class ContextConfig implements LifecycleListener {
context.addChild(wrapper);
}
for (Entry<String,String> entry : webxml.getServletMappings().entrySet()) {
- context.addServletMappingDecoded(entry.getKey(), entry.getValue());
+ context.addServletMapping(entry.getKey(), entry.getValue());
}
SessionConfig sessionConfig = webxml.getSessionConfig();
if (sessionConfig != null) {
@@ -1641,7 +1642,7 @@ public class ContextConfig implements LifecycleListener {
}
if (context.findChild(jspServletName) != null) {
for (String urlPattern : jspPropertyGroup.getUrlPatterns()) {
- context.addServletMappingDecoded(urlPattern, jspServletName, true);
+ context.addServletMapping(urlPattern, jspServletName, true);
}
} else {
if (log.isDebugEnabled()) {
@@ -1834,8 +1835,9 @@ public class ContextConfig implements LifecycleListener {
*
* @return a new WebXml instance
*/
+ @SuppressWarnings("deprecation")
protected WebXml createWebXml() {
- return new WebXml();
+ return new WebXml(context.getUrlPatternsProvidedInDecodedForm());
}
/**
@@ -2163,7 +2165,8 @@ public class ContextConfig implements LifecycleListener {
// - this fragment has metadata-complete="true"
boolean htOnly = handlesTypesOnly || !fragment.getWebappJar() || fragment.isMetadataComplete();
- WebXml annotations = new WebXml();
+ @SuppressWarnings("deprecation")
+ WebXml annotations = new WebXml(context.getUrlPatternsProvidedInDecodedForm());
// no impact on distributable
annotations.setDistributable(true);
URL url = fragment.getURL();
@@ -2709,6 +2712,7 @@ public class ContextConfig implements LifecycleListener {
* @param ae The filter annotation
* @param fragment The corresponding fragment
*/
+ @SuppressWarnings("deprecation")
protected void processAnnotationWebFilter(String className, AnnotationEntry ae, WebXml fragment) {
String filterName = null;
// must search for name s. Spec Servlet API 3.0 - 8.2.3.3.n.ii page 81
@@ -2752,8 +2756,12 @@ public class ContextConfig implements LifecycleListener {
urlPatterns = processAnnotationsStringArray(evp.getValue());
urlPatternsSet = urlPatterns.length > 0;
for (String urlPattern : urlPatterns) {
- // % decoded (if required) using UTF-8
- filterMap.addURLPattern(urlPattern);
+ if (fragment.getUrlPatternsProvidedInDecodedForm()) {
+ filterMap.addURLPatternDecoded(urlPattern);
+ } else {
+ // % decoded (if required) using UTF-8
+ filterMap.addURLPattern(urlPattern);
+ }
}
} else if ("servletNames".equals(name)) {
String[] servletNames = processAnnotationsStringArray(evp.getValue());
diff --git a/java/org/apache/catalina/startup/FailedContext.java b/java/org/apache/catalina/startup/FailedContext.java
index 29b7492a2a..c23b4ffb93 100644
--- a/java/org/apache/catalina/startup/FailedContext.java
+++ b/java/org/apache/catalina/startup/FailedContext.java
@@ -966,6 +966,12 @@ public class FailedContext extends LifecycleMBeanBase implements Context {
}
@Override
+ public void addServletMapping(String pattern, String name, boolean jspWildcard) {
+ // NO-OP
+ }
+
+ @Override
+ @Deprecated
public void addServletMappingDecoded(String pattern, String name, boolean jspWildcard) {
// NO-OP
}
diff --git a/java/org/apache/catalina/startup/Tomcat.java b/java/org/apache/catalina/startup/Tomcat.java
index ed7a7c5619..e271e7c666 100644
--- a/java/org/apache/catalina/startup/Tomcat.java
+++ b/java/org/apache/catalina/startup/Tomcat.java
@@ -1052,9 +1052,9 @@ public class Tomcat {
servlet.setOverridable(true);
// Servlet mappings
- ctx.addServletMappingDecoded("/", "default");
- ctx.addServletMappingDecoded("*.jsp", "jsp");
- ctx.addServletMappingDecoded("*.jspx", "jsp");
+ ctx.addServletMapping("/", "default");
+ ctx.addServletMapping("*.jsp", "jsp");
+ ctx.addServletMapping("*.jspx", "jsp");
// Sessions
ctx.setSessionTimeout(30);
diff --git a/java/org/apache/tomcat/util/descriptor/web/ErrorPage.java b/java/org/apache/tomcat/util/descriptor/web/ErrorPage.java
index ac0a4f7d8c..04e201b5b4 100644
--- a/java/org/apache/tomcat/util/descriptor/web/ErrorPage.java
+++ b/java/org/apache/tomcat/util/descriptor/web/ErrorPage.java
@@ -24,6 +24,7 @@ import org.apache.tomcat.util.buf.UDecoder;
* Representation of an error page element for a web application, as represented in a <code><error-page></code>
* element in the deployment descriptor.
*/
+@SuppressWarnings("deprecation")
public class ErrorPage extends XmlEncodingBase implements Serializable {
/**
@@ -139,7 +140,10 @@ public class ErrorPage extends XmlEncodingBase implements Serializable {
* Set the already URL decoded location.
*
* @param location The new location
+ *
+ * @deprecated This method will be removed in Tomcat 12
*/
+ @Deprecated
public void setLocationDecoded(String location) {
this.location = location;
}
diff --git a/java/org/apache/tomcat/util/descriptor/web/FilterMap.java b/java/org/apache/tomcat/util/descriptor/web/FilterMap.java
index 2032399774..84f115becc 100644
--- a/java/org/apache/tomcat/util/descriptor/web/FilterMap.java
+++ b/java/org/apache/tomcat/util/descriptor/web/FilterMap.java
@@ -30,6 +30,7 @@ import org.apache.tomcat.util.buf.UDecoder;
* element in the deployment descriptor. Each filter mapping must contain a filter name plus either a URL pattern or a
* servlet name.
*/
+@SuppressWarnings("deprecation")
public class FilterMap extends XmlEncodingBase implements Serializable {
/**
@@ -195,7 +196,10 @@ public class FilterMap extends XmlEncodingBase implements Serializable {
* Adds a decoded URL pattern to the set of URL patterns this mapping matches.
*
* @param urlPattern The decoded URL pattern to add
+ *
+ * @deprecated This method will be removed in Tomcat 12 onwards
*/
+ @Deprecated
public void addURLPatternDecoded(String urlPattern) {
if ("*".equals(urlPattern)) {
this.matchAllUrlPatterns = true;
diff --git a/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java b/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java
index 78eb1d9c76..117a12df47 100644
--- a/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java
+++ b/java/org/apache/tomcat/util/descriptor/web/FragmentJarScannerCallback.java
@@ -58,7 +58,8 @@ public class FragmentJarScannerCallback implements JarScannerCallback {
public void scan(Jar jar, String webappPath, boolean isWebapp) throws IOException {
InputStream is = null;
- WebXml fragment = new WebXml();
+ @SuppressWarnings("deprecation")
+ WebXml fragment = new WebXml(webXmlParser.getUrlPatternsProvidedInDecodedForm());
fragment.setWebappJar(isWebapp);
fragment.setDelegate(delegate);
@@ -104,7 +105,8 @@ public class FragmentJarScannerCallback implements JarScannerCallback {
@Override
public void scan(File file, String webappPath, boolean isWebapp) throws IOException {
- WebXml fragment = new WebXml();
+ @SuppressWarnings("deprecation")
+ WebXml fragment = new WebXml(webXmlParser.getUrlPatternsProvidedInDecodedForm());
fragment.setWebappJar(isWebapp);
fragment.setDelegate(delegate);
diff --git a/java/org/apache/tomcat/util/descriptor/web/JspPropertyGroup.java b/java/org/apache/tomcat/util/descriptor/web/JspPropertyGroup.java
index 2a3a74a4f2..f889050bfe 100644
--- a/java/org/apache/tomcat/util/descriptor/web/JspPropertyGroup.java
+++ b/java/org/apache/tomcat/util/descriptor/web/JspPropertyGroup.java
@@ -26,6 +26,7 @@ import org.apache.tomcat.util.buf.UDecoder;
/**
* Representation of a jsp-property-group element in web.xml.
*/
+@SuppressWarnings("deprecation")
public class JspPropertyGroup extends XmlEncodingBase {
/**
@@ -210,7 +211,9 @@ public class JspPropertyGroup extends XmlEncodingBase {
* Adds a pre-decoded URL pattern to this property group.
*
* @param urlPattern the decoded URL pattern to add
+ * @deprecated This method will be removed in Tomcat 12
*/
+ @Deprecated
public void addUrlPatternDecoded(String urlPattern) {
this.urlPattern.add(urlPattern);
}
diff --git a/java/org/apache/tomcat/util/descriptor/web/LoginConfig.java b/java/org/apache/tomcat/util/descriptor/web/LoginConfig.java
index a46294cbe0..48abf88703 100644
--- a/java/org/apache/tomcat/util/descriptor/web/LoginConfig.java
+++ b/java/org/apache/tomcat/util/descriptor/web/LoginConfig.java
@@ -24,6 +24,7 @@ import org.apache.tomcat.util.buf.UDecoder;
* Representation of a login configuration element for a web application, as represented in a
* <code><login-config></code> element in the deployment descriptor.
*/
+@SuppressWarnings("deprecation")
public class LoginConfig extends XmlEncodingBase implements Serializable {
@@ -116,7 +117,10 @@ public class LoginConfig extends XmlEncodingBase implements Serializable {
* Set the already decoded error page URI.
*
* @param errorPage the decoded errorPage to set
+ *
+ * @deprecated Will be removed in Tomcat 12 onwards
*/
+ @Deprecated
public void setErrorPageDecoded(String errorPage) {
this.errorPage = errorPage;
}
@@ -150,7 +154,10 @@ public class LoginConfig extends XmlEncodingBase implements Serializable {
* Set the already decoded login page URI.
*
* @param loginPage the decoded loginPage to set
+ *
+ * @deprecated Will be removed in Tomcat 12 onwards
*/
+ @Deprecated
public void setLoginPageDecoded(String loginPage) {
this.loginPage = loginPage;
}
diff --git a/java/org/apache/tomcat/util/descriptor/web/SecurityCollection.java b/java/org/apache/tomcat/util/descriptor/web/SecurityCollection.java
index abe60162d3..0a298ab112 100644
--- a/java/org/apache/tomcat/util/descriptor/web/SecurityCollection.java
+++ b/java/org/apache/tomcat/util/descriptor/web/SecurityCollection.java
@@ -30,6 +30,7 @@ import org.apache.tomcat.util.buf.UDecoder;
* single thread, before the instance is made visible to the remainder of the application. After that, only read access
* is expected. Therefore, none of the read and write access within this class is synchronized.
*/
+@SuppressWarnings("deprecation")
public class SecurityCollection extends XmlEncodingBase implements Serializable {
private static final long serialVersionUID = 1L;
@@ -209,7 +210,10 @@ public class SecurityCollection extends XmlEncodingBase implements Serializable
* Add a URL pattern (already decoded) to be part of this web resource collection.
*
* @param pattern The decoded pattern
+ *
+ * @deprecated Will be removed in Tomcat 12 onwards
*/
+ @Deprecated
public void addPatternDecoded(String pattern) {
if (pattern == null) {
diff --git a/java/org/apache/tomcat/util/descriptor/web/SecurityConstraint.java b/java/org/apache/tomcat/util/descriptor/web/SecurityConstraint.java
index d89ff7de16..36c26e79b0 100644
--- a/java/org/apache/tomcat/util/descriptor/web/SecurityConstraint.java
+++ b/java/org/apache/tomcat/util/descriptor/web/SecurityConstraint.java
@@ -45,6 +45,7 @@ import org.apache.tomcat.util.res.StringManager;
* single thread, before the instance is made visible to the remainder of the application. After that, only read access
* is expected. Therefore, none of the read and write access within this class is synchronized.
*/
+@SuppressWarnings("deprecation")
public class SecurityConstraint extends XmlEncodingBase implements Serializable {
private static final long serialVersionUID = 1L;
diff --git a/java/org/apache/tomcat/util/descriptor/web/WebRuleSet.java b/java/org/apache/tomcat/util/descriptor/web/WebRuleSet.java
index fe2a6b0a27..acbc283847 100644
--- a/java/org/apache/tomcat/util/descriptor/web/WebRuleSet.java
+++ b/java/org/apache/tomcat/util/descriptor/web/WebRuleSet.java
@@ -96,8 +96,10 @@ public class WebRuleSet implements RuleSet {
protected final RelativeOrderingRule relativeOrdering;
- // ------------------------------------------------------------ Constructor
+ private final boolean urlPatternsProvidedInDecodedForm;
+
+ // ------------------------------------------------------------ Constructor
/**
* Construct an instance of this <code>RuleSet</code> with the default matching pattern prefix and default fragment
@@ -129,6 +131,22 @@ public class WebRuleSet implements RuleSet {
* @param fragment <code>true</code> if this is a web fragment
*/
public WebRuleSet(String prefix, boolean fragment) {
+ this(prefix, fragment, false);
+ }
+
+
+ /**
+ * Construct an instance of this <code>RuleSet</code> with the specified matching pattern prefix.
+ *
+ * @param prefix Prefix for matching pattern rules (including the trailing slash
+ * character)
+ * @param fragment <code>true</code> if this is a web fragment
+ * @param urlPatternsProvidedInDecodedForm Whether URL and URL patterns will be provided in decoded form
+ *
+ * @deprecated This constructor will be removed in Tomcat 12
+ */
+ @Deprecated
+ public WebRuleSet(String prefix, boolean fragment, boolean urlPatternsProvidedInDecodedForm) {
this.prefix = prefix;
this.fragment = fragment;
@@ -140,6 +158,7 @@ public class WebRuleSet implements RuleSet {
absoluteOrdering = new AbsoluteOrderingRule(fragment);
relativeOrdering = new RelativeOrderingRule(fragment);
+ this.urlPatternsProvidedInDecodedForm = urlPatternsProvidedInDecodedForm;
}
@@ -195,7 +214,11 @@ public class WebRuleSet implements RuleSet {
digester.addCallMethod(fullPrefix + "/error-page/error-code", "setErrorCode", 0);
digester.addCallMethod(fullPrefix + "/error-page/exception-type", "setExceptionType", 0);
- digester.addCallMethod(fullPrefix + "/error-page/location", "setLocation", 0);
+ if (urlPatternsProvidedInDecodedForm) {
+ digester.addCallMethod(fullPrefix + "/error-page/location", "setLocationDecoded", 0);
+ } else {
+ digester.addCallMethod(fullPrefix + "/error-page/location", "setLocation", 0);
+ }
digester.addObjectCreate(fullPrefix + "/filter", "org.apache.tomcat.util.descriptor.web.FilterDef");
digester.addSetNext(fullPrefix + "/filter", "addFilter", "org.apache.tomcat.util.descriptor.web.FilterDef");
@@ -218,7 +241,11 @@ public class WebRuleSet implements RuleSet {
digester.addCallMethod(fullPrefix + "/filter-mapping/filter-name", "setFilterName", 0);
digester.addCallMethod(fullPrefix + "/filter-mapping/servlet-name", "addServletName", 0);
- digester.addCallMethod(fullPrefix + "/filter-mapping/url-pattern", "addURLPattern", 0);
+ if (urlPatternsProvidedInDecodedForm) {
+ digester.addCallMethod(fullPrefix + "/filter-mapping/url-pattern", "addURLPatternDecoded", 0);
+ } else {
+ digester.addCallMethod(fullPrefix + "/filter-mapping/url-pattern", "addURLPattern", 0);
+ }
digester.addCallMethod(fullPrefix + "/filter-mapping/dispatcher", "setDispatcher", 0);
@@ -241,7 +268,12 @@ public class WebRuleSet implements RuleSet {
0);
digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/trim-directive-whitespaces",
"setTrimWhitespace", 0);
- digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/url-pattern", "addUrlPattern", 0);
+ if (urlPatternsProvidedInDecodedForm) {
+ digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/url-pattern", "addUrlPatternDecoded",
+ 0);
+ } else {
+ digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/url-pattern", "addUrlPattern", 0);
+ }
digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/default-content-type",
"setDefaultContentType", 0);
digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/buffer", "setBuffer", 0);
@@ -256,8 +288,16 @@ public class WebRuleSet implements RuleSet {
digester.addCallMethod(fullPrefix + "/login-config/auth-method", "setAuthMethod", 0);
digester.addCallMethod(fullPrefix + "/login-config/realm-name", "setRealmName", 0);
- digester.addCallMethod(fullPrefix + "/login-config/form-login-config/form-error-page", "setErrorPage", 0);
- digester.addCallMethod(fullPrefix + "/login-config/form-login-config/form-login-page", "setLoginPage", 0);
+
+ if (urlPatternsProvidedInDecodedForm) {
+ digester.addCallMethod(fullPrefix + "/login-config/form-login-config/form-error-page",
+ "setErrorPageDecoded", 0);
+ digester.addCallMethod(fullPrefix + "/login-config/form-login-config/form-login-page",
+ "setLoginPageDecoded", 0);
+ } else {
+ digester.addCallMethod(fullPrefix + "/login-config/form-login-config/form-error-page", "setErrorPage", 0);
+ digester.addCallMethod(fullPrefix + "/login-config/form-login-config/form-login-page", "setLoginPage", 0);
+ }
digester.addCallMethod(fullPrefix + "/mime-mapping", "addMimeMapping", 2);
digester.addCallParam(fullPrefix + "/mime-mapping/extension", 0);
@@ -282,8 +322,13 @@ public class WebRuleSet implements RuleSet {
digester.addCallMethod(fullPrefix + "/security-constraint/web-resource-collection/http-method", "addMethod", 0);
digester.addCallMethod(fullPrefix + "/security-constraint/web-resource-collection/http-method-omission",
"addOmittedMethod", 0);
- digester.addCallMethod(fullPrefix + "/security-constraint/web-resource-collection/url-pattern", "addPattern",
- 0);
+ if (urlPatternsProvidedInDecodedForm) {
+ digester.addCallMethod(fullPrefix + "/security-constraint/web-resource-collection/url-pattern",
+ "addPatternDecoded", 0);
+ } else {
+ digester.addCallMethod(fullPrefix + "/security-constraint/web-resource-collection/url-pattern",
+ "addPattern", 0);
+ }
digester.addCallMethod(fullPrefix + "/security-constraint/web-resource-collection/web-resource-name", "setName",
0);
diff --git a/java/org/apache/tomcat/util/descriptor/web/WebXml.java b/java/org/apache/tomcat/util/descriptor/web/WebXml.java
index 3417f54a70..f712d62cfd 100644
--- a/java/org/apache/tomcat/util/descriptor/web/WebXml.java
+++ b/java/org/apache/tomcat/util/descriptor/web/WebXml.java
@@ -56,12 +56,28 @@ import org.apache.tomcat.util.security.Escape;
* (e.g. single login-config) This class checks for invalid duplicates (e.g. filter/servlet names) StandardContext will
* check validity of values (e.g. URL formats etc)
*/
+@SuppressWarnings("deprecation")
public class WebXml extends XmlEncodingBase implements DocumentProperties.Charset {
/**
* Constructs a new WebXml.
*/
public WebXml() {
+ this(false);
+ }
+
+ /**
+ * Constructs a new WebXml with configurable behaviour for URL and URL pattern decoding.
+ *
+ * @param urlPatternsProvidedInDecodedForm {@code true} if URLs and URL patterns are expected to be decoded.
+ * {@code false} if they are expected to be URL-encoded (i.e.
+ * {@code %nn} encoding)
+ *
+ * @deprecated This constructor will be removed in Tomcat 12
+ */
+ @Deprecated
+ public WebXml(boolean urlPatternsProvidedInDecodedForm) {
+ this.urlPatternsProvidedInDecodedForm = urlPatternsProvidedInDecodedForm;
}
/**
@@ -75,6 +91,26 @@ public class WebXml extends XmlEncodingBase implements DocumentProperties.Charse
private final UEncoder urlEncoder = new UEncoder(SafeCharsSet.WITH_SLASH);
+ private final boolean urlPatternsProvidedInDecodedForm;
+
+
+ /**
+ * Does this Context expect URLs and URL patterns provided in web.xml, annotations and their programmatic
+ * equivalents to be in URL-decoded form?
+ * <p>
+ * As per the Servlet specification, "URI paths specified in the deployment descriptor are assumed to be in
+ * URL-decoded form.".
+ *
+ * @return {@code true} if URLs and URL patterns are expected in URL-decoded form, otherwise {@code false}
+ *
+ * @deprecated This method will be removed in Tomcat 12 where the field will be effectively hard-coded to
+ * {@code true}
+ */
+ @Deprecated
+ public boolean getUrlPatternsProvidedInDecodedForm() {
+ return urlPatternsProvidedInDecodedForm;
+ }
+
/**
* Global defaults are overridable but Servlets and Servlet mappings need to be unique. Duplicates normally trigger
* an error. This flag indicates if newly added Servlet elements are marked as overridable.
@@ -484,8 +520,8 @@ public class WebXml extends XmlEncodingBase implements DocumentProperties.Charse
/**
* Adds a context parameter.
*
- * @param param The parameter name
- * @param value The parameter value
+ * @param param The parameter name
+ * @param value The parameter value
*/
public void addContextParam(String param, String value) {
contextParams.put(param, value);
@@ -617,21 +653,27 @@ public class WebXml extends XmlEncodingBase implements DocumentProperties.Charse
/**
* Adds a servlet URL mapping.
*
- * @param urlPattern The URL pattern
- * @param servletName The servlet name
+ * @param urlPattern The URL pattern
+ * @param servletName The servlet name
*/
public void addServletMapping(String urlPattern, String servletName) {
- addServletMappingDecoded(UDecoder.URLDecode(urlPattern, getCharset()), servletName);
+ if (!urlPatternsProvidedInDecodedForm) {
+ urlPattern = UDecoder.URLDecode(urlPattern, getCharset());
+ }
+ addServletMappingDecoded(urlPattern, servletName);
}
/**
* Adds a servlet URL mapping (already decoded).
*
- * @param urlPattern The URL pattern
- * @param servletName The servlet name
+ * @param urlPattern The URL pattern
+ * @param servletName The servlet name
*
* @throws IllegalArgumentException If a duplicate mapping exists
+ *
+ * @deprecated Will be removed in Tomcat 12 onwards
*/
+ @Deprecated
public void addServletMappingDecoded(String urlPattern, String servletName) {
String oldServletName = servletMappings.put(urlPattern, servletName);
if (oldServletName != null) {
@@ -680,8 +722,8 @@ public class WebXml extends XmlEncodingBase implements DocumentProperties.Charse
/**
* Adds a MIME mapping.
*
- * @param extension The file extension
- * @param mimeType The MIME type
+ * @param extension The file extension
+ * @param mimeType The MIME type
*/
public void addMimeMapping(String extension, String mimeType) {
mimeMappings.put(extension, mimeType);
@@ -1738,7 +1780,8 @@ public class WebXml extends XmlEncodingBase implements DocumentProperties.Charse
}
sb.append(" </web-resource-collection>\n");
}
- if (constraint.findAuthRoles().length > 0 || constraint.getAllRoles() || constraint.getAuthenticatedUsers()) {
+ if (constraint.findAuthRoles().length > 0 || constraint.getAllRoles() ||
+ constraint.getAuthenticatedUsers()) {
sb.append(" <auth-constraint>\n");
for (String role : constraint.findAuthRoles()) {
appendElement(sb, INDENT6, "role-name", role);
@@ -2051,7 +2094,7 @@ public class WebXml extends XmlEncodingBase implements DocumentProperties.Charse
// Merge rules vary from element to element. See SRV.8.2.3
- WebXml temp = new WebXml();
+ WebXml temp = new WebXml(urlPatternsProvidedInDecodedForm);
for (WebXml fragment : fragments) {
if (!mergeMap(fragment.getContextParams(), contextParams, temp.getContextParams(), fragment,
diff --git a/java/org/apache/tomcat/util/descriptor/web/WebXmlParser.java b/java/org/apache/tomcat/util/descriptor/web/WebXmlParser.java
index a25a72de11..4806442d23 100644
--- a/java/org/apache/tomcat/util/descriptor/web/WebXmlParser.java
+++ b/java/org/apache/tomcat/util/descriptor/web/WebXmlParser.java
@@ -52,24 +52,43 @@ public class WebXmlParser {
*/
private final Digester webFragmentDigester;
private final WebRuleSet webFragmentRuleSet;
-
+ private final boolean urlPatternsProvidedInDecodedForm;
/**
* Constructs a new WebXmlParser.
*
- * @param namespaceAware Whether the parser is namespace aware
- * @param validation Whether validation is enabled
- * @param blockExternal Whether external entities are blocked
+ * @param namespaceAware Whether the parser is namespace aware
+ * @param validation Whether validation is enabled
+ * @param blockExternal Whether external entities are blocked
*/
public WebXmlParser(boolean namespaceAware, boolean validation, boolean blockExternal) {
- webRuleSet = new WebRuleSet(false);
+ this(namespaceAware, validation, blockExternal, false);
+ }
+
+
+ /**
+ * Constructs a new WebXmlParser.
+ *
+ * @param namespaceAware Whether the parser is namespace aware
+ * @param validation Whether validation is enabled
+ * @param blockExternal Whether external entities are blocked
+ * @param urlPatternsProvidedInDecodedForm Whether URL and URL patterns will be provided in decoded form
+ *
+ * @deprecated This constructor will be removed in Tomcat 12
+ */
+ @Deprecated
+ public WebXmlParser(boolean namespaceAware, boolean validation, boolean blockExternal,
+ boolean urlPatternsProvidedInDecodedForm) {
+
+ webRuleSet = new WebRuleSet("", false, urlPatternsProvidedInDecodedForm);
webDigester = DigesterFactory.newDigester(validation, namespaceAware, webRuleSet, blockExternal);
webDigester.getParser();
- webFragmentRuleSet = new WebRuleSet(true);
+ webFragmentRuleSet = new WebRuleSet("", true, urlPatternsProvidedInDecodedForm);
webFragmentDigester =
DigesterFactory.newDigester(validation, namespaceAware, webFragmentRuleSet, blockExternal);
webFragmentDigester.getParser();
+ this.urlPatternsProvidedInDecodedForm = urlPatternsProvidedInDecodedForm;
}
/**
@@ -163,4 +182,18 @@ public class WebXmlParser {
webDigester.setClassLoader(classLoader);
webFragmentDigester.setClassLoader(classLoader);
}
-}
\ No newline at end of file
+
+
+ /**
+ * Does this parser expect URLs and URL patterns provided in web.xml, annotations and their programmatic
+ * equivalents to be in URL-decoded form?
+ *
+ * @return {@code true} if URLs and URL patterns are expected in URL-decoded form, otherwise {@code false}
+ *
+ * @deprecated This method will be removed in Tomcat 12 where it will effectively be hard-coded to {@code true}
+ */
+ @Deprecated
+ public boolean getUrlPatternsProvidedInDecodedForm() {
+ return urlPatternsProvidedInDecodedForm;
+ }
+}
diff --git a/java/org/apache/tomcat/util/descriptor/web/XmlEncodingBase.java b/java/org/apache/tomcat/util/descriptor/web/XmlEncodingBase.java
index 9c8f96c89f..666f7c2525 100644
--- a/java/org/apache/tomcat/util/descriptor/web/XmlEncodingBase.java
+++ b/java/org/apache/tomcat/util/descriptor/web/XmlEncodingBase.java
@@ -21,23 +21,29 @@ import java.nio.charset.StandardCharsets;
/**
* Base class for those elements that need to track the encoding used in the source XML.
+ *
+ * @deprecated This abstract class will be removed in Tomcat 12 onwards
*/
+@Deprecated
public abstract class XmlEncodingBase {
+ private Charset charset = StandardCharsets.UTF_8;
+
+
/**
* Default constructor.
*/
+ @Deprecated
public XmlEncodingBase() {
}
- private Charset charset = StandardCharsets.UTF_8;
-
/**
* Set the character encoding of the XML source used to populate this object.
*
* @param charset The character encoding
*/
+ @Deprecated
public void setCharset(Charset charset) {
this.charset = charset;
}
@@ -49,6 +55,7 @@ public abstract class XmlEncodingBase {
* @return The character encoding of the associated XML source or <code>UTF-8</code> if the encoding could not be
* determined
*/
+ @Deprecated
public Charset getCharset() {
return charset;
}
diff --git a/test/javax/servlet/annotation/TestServletSecurity.java b/test/javax/servlet/annotation/TestServletSecurity.java
index 2d5099877b..fae5ab1bf4 100644
--- a/test/javax/servlet/annotation/TestServletSecurity.java
+++ b/test/javax/servlet/annotation/TestServletSecurity.java
@@ -53,10 +53,10 @@ public class TestServletSecurity extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "Foo", Foo.class.getName());
- ctx.addServletMappingDecoded("/foo/*", "Foo");
+ ctx.addServletMapping("/foo/*", "Foo");
Tomcat.addServlet(ctx, "FooBar", FooBar.class.getName());
- ctx.addServletMappingDecoded("/foo/bar/*", "FooBar");
+ ctx.addServletMapping("/foo/bar/*", "FooBar");
tomcat.start();
diff --git a/test/javax/servlet/http/HttpServletDoHeadBaseTest.java b/test/javax/servlet/http/HttpServletDoHeadBaseTest.java
index 03b928fee3..3470ff1bed 100644
--- a/test/javax/servlet/http/HttpServletDoHeadBaseTest.java
+++ b/test/javax/servlet/http/HttpServletDoHeadBaseTest.java
@@ -207,12 +207,12 @@ public class HttpServletDoHeadBaseTest extends Http2TestBase {
StandardContext ctxt = (StandardContext) getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
HeadTestServlet s = new HeadTestServlet(bufferSize, useWriter, invalidWriteCount, resetType, validWriteCount,
explicitFlush);
Tomcat.addServlet(ctxt, "HeadTestServlet", s);
- ctxt.addServletMappingDecoded("/test", "HeadTestServlet");
+ ctxt.addServletMapping("/test", "HeadTestServlet");
tomcat.start();
}
diff --git a/test/javax/servlet/http/TestHttpServlet.java b/test/javax/servlet/http/TestHttpServlet.java
index 9e3c9630db..14e5f37b7e 100644
--- a/test/javax/servlet/http/TestHttpServlet.java
+++ b/test/javax/servlet/http/TestHttpServlet.java
@@ -57,7 +57,7 @@ public class TestHttpServlet extends TomcatBaseTest {
// Map the test Servlet
LargeBodyServlet largeBodyServlet = new LargeBodyServlet();
Tomcat.addServlet(ctx, "largeBodyServlet", largeBodyServlet);
- ctx.addServletMappingDecoded("/", "largeBodyServlet");
+ ctx.addServletMapping("/", "largeBodyServlet");
tomcat.start();
@@ -94,11 +94,11 @@ public class TestHttpServlet extends TomcatBaseTest {
Bug57602ServletOuter outer = new Bug57602ServletOuter();
Tomcat.addServlet(ctx, "Bug57602ServletOuter", outer);
- ctx.addServletMappingDecoded("/outer", "Bug57602ServletOuter");
+ ctx.addServletMapping("/outer", "Bug57602ServletOuter");
Bug57602ServletInner inner = new Bug57602ServletInner();
Tomcat.addServlet(ctx, "Bug57602ServletInner", inner);
- ctx.addServletMappingDecoded("/inner", "Bug57602ServletInner");
+ ctx.addServletMapping("/inner", "Bug57602ServletInner");
tomcat.start();
@@ -167,7 +167,7 @@ public class TestHttpServlet extends TomcatBaseTest {
Wrapper w = Tomcat.addServlet(ctx, "TestServlet", servlet);
// Not all need/use this but it is simpler to set it for all
w.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/test", "TestServlet");
+ ctx.addServletMapping("/test", "TestServlet");
tomcat.start();
@@ -233,7 +233,7 @@ public class TestHttpServlet extends TomcatBaseTest {
// Map the test Servlet
Tomcat.addServlet(ctx, "servlet", servlet);
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
@@ -313,7 +313,7 @@ public class TestHttpServlet extends TomcatBaseTest {
// Map the test Servlet
Tomcat.addServlet(ctx, "servlet", new SimpleServlet());
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
@@ -377,7 +377,7 @@ public class TestHttpServlet extends TomcatBaseTest {
Context root = tomcat.addContext("", TEMP_DIR);
Tomcat.addServlet(root, "TesterServlet", new TesterServlet());
- root.addServletMappingDecoded("/test", "TesterServlet");
+ root.addServletMapping("/test", "TesterServlet");
try {
tomcat.start();
diff --git a/test/javax/servlet/http/TestHttpServletResponseSendError.java b/test/javax/servlet/http/TestHttpServletResponseSendError.java
index 94cb116d36..8b9ff98a3e 100644
--- a/test/javax/servlet/http/TestHttpServletResponseSendError.java
+++ b/test/javax/servlet/http/TestHttpServletResponseSendError.java
@@ -138,14 +138,14 @@ public class TestHttpServletResponseSendError extends TomcatBaseTest {
} else {
Tomcat.addServlet(ctx, "target", new TesterServlet(throwException));
}
- ctx.addServletMappingDecoded("/target", "target");
+ ctx.addServletMapping("/target", "target");
Tomcat.addServlet(ctx, "dispatch", new TesterDispatchServlet());
- ctx.addServletMappingDecoded("/dispatch", "dispatch");
+ ctx.addServletMapping("/dispatch", "dispatch");
Tomcat.addServlet(ctx, "error599", new ErrorServletStatic599());
- ctx.addServletMappingDecoded("/error599", "error599");
+ ctx.addServletMapping("/error599", "error599");
Tomcat.addServlet(ctx, "errorException", new ErrorServletStaticException());
- ctx.addServletMappingDecoded("/errorException", "errorException");
+ ctx.addServletMapping("/errorException", "errorException");
ErrorPage ep1 = new ErrorPage();
ep1.setErrorCode(599);
diff --git a/test/org/apache/catalina/authenticator/TestAuthInfoResponseHeaders.java b/test/org/apache/catalina/authenticator/TestAuthInfoResponseHeaders.java
index ae600d6885..5261805ec4 100644
--- a/test/org/apache/catalina/authenticator/TestAuthInfoResponseHeaders.java
+++ b/test/org/apache/catalina/authenticator/TestAuthInfoResponseHeaders.java
@@ -141,9 +141,9 @@ public class TestAuthInfoResponseHeaders extends TomcatBaseTest {
// Add protected servlet
Tomcat.addServlet(ctxt, "TesterServlet", new TesterServlet());
- ctxt.addServletMappingDecoded(URI, "TesterServlet");
+ ctxt.addServletMapping(URI, "TesterServlet");
SecurityCollection collection = new SecurityCollection();
- collection.addPatternDecoded(URI);
+ collection.addPattern(URI);
SecurityConstraint sc = new SecurityConstraint();
sc.addAuthRole(ROLE);
sc.addCollection(collection);
diff --git a/test/org/apache/catalina/authenticator/TestAuthenticatorBaseCorsPreflight.java b/test/org/apache/catalina/authenticator/TestAuthenticatorBaseCorsPreflight.java
index 5d2cacb220..46b8c700e2 100644
--- a/test/org/apache/catalina/authenticator/TestAuthenticatorBaseCorsPreflight.java
+++ b/test/org/apache/catalina/authenticator/TestAuthenticatorBaseCorsPreflight.java
@@ -117,7 +117,7 @@ public class TestAuthenticatorBaseCorsPreflight extends TomcatBaseTest {
Context ctx = tomcat.addContext("", appDir.getAbsolutePath());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
LoginConfig loginConfig = new LoginConfig();
loginConfig.setAuthMethod("BASIC");
@@ -143,7 +143,7 @@ public class TestAuthenticatorBaseCorsPreflight extends TomcatBaseTest {
otherFilter.setFilterClass(AddDefaultCharsetFilter.class.getName());
FilterMap otherMap = new FilterMap();
otherMap.setFilterName("other");
- otherMap.addURLPatternDecoded("/other");
+ otherMap.addURLPattern("/other");
ctx.addFilterDef(otherFilter);
ctx.addFilterMap(otherMap);
@@ -154,7 +154,7 @@ public class TestAuthenticatorBaseCorsPreflight extends TomcatBaseTest {
corsFilter.addInitParameter(CorsFilter.PARAM_CORS_ALLOWED_METHODS, ALLOWED_METHOD);
FilterMap corsFilterMap = new FilterMap();
corsFilterMap.setFilterName("cors");
- corsFilterMap.addURLPatternDecoded(filterMapping);
+ corsFilterMap.addURLPattern(filterMapping);
ctx.addFilterDef(corsFilter);
ctx.addFilterMap(corsFilterMap);
diff --git a/test/org/apache/catalina/authenticator/TestDigestAuthenticator.java b/test/org/apache/catalina/authenticator/TestDigestAuthenticator.java
index 72f9bf5039..0ebff3d297 100644
--- a/test/org/apache/catalina/authenticator/TestDigestAuthenticator.java
+++ b/test/org/apache/catalina/authenticator/TestDigestAuthenticator.java
@@ -248,9 +248,9 @@ public class TestDigestAuthenticator extends TomcatBaseTest {
// Add protected servlet
Tomcat.addServlet(ctxt, "TesterServlet", new TesterServlet());
- ctxt.addServletMappingDecoded(URI, "TesterServlet");
+ ctxt.addServletMapping(URI, "TesterServlet");
SecurityCollection collection = new SecurityCollection();
- collection.addPatternDecoded(URI);
+ collection.addPattern(URI);
SecurityConstraint sc = new SecurityConstraint();
sc.addAuthRole(ROLE);
sc.addCollection(collection);
diff --git a/test/org/apache/catalina/authenticator/TestDigestAuthenticatorAlgorithms.java b/test/org/apache/catalina/authenticator/TestDigestAuthenticatorAlgorithms.java
index d5027c4b4c..c3d2d0eca7 100644
--- a/test/org/apache/catalina/authenticator/TestDigestAuthenticatorAlgorithms.java
+++ b/test/org/apache/catalina/authenticator/TestDigestAuthenticatorAlgorithms.java
@@ -131,9 +131,9 @@ public class TestDigestAuthenticatorAlgorithms extends TomcatBaseTest {
// Add protected servlet
Tomcat.addServlet(ctxt, "TesterServlet", new TesterServlet());
- ctxt.addServletMappingDecoded(URI, "TesterServlet");
+ ctxt.addServletMapping(URI, "TesterServlet");
SecurityCollection collection = new SecurityCollection();
- collection.addPatternDecoded(URI);
+ collection.addPattern(URI);
SecurityConstraint sc = new SecurityConstraint();
sc.addAuthRole("role");
sc.addCollection(collection);
diff --git a/test/org/apache/catalina/authenticator/TestDigestAuthenticatorB.java b/test/org/apache/catalina/authenticator/TestDigestAuthenticatorB.java
index ae64f34a83..6173a9bd41 100644
--- a/test/org/apache/catalina/authenticator/TestDigestAuthenticatorB.java
+++ b/test/org/apache/catalina/authenticator/TestDigestAuthenticatorB.java
@@ -83,9 +83,9 @@ public class TestDigestAuthenticatorB extends TomcatBaseTest {
// Add protected servlet
Tomcat.addServlet(ctxt, "TesterServlet", new TesterServlet());
- ctxt.addServletMappingDecoded(targetURI, "TesterServlet");
+ ctxt.addServletMapping(targetURI, "TesterServlet");
SecurityCollection collection = new SecurityCollection();
- collection.addPatternDecoded(targetURI);
+ collection.addPattern(targetURI);
SecurityConstraint sc = new SecurityConstraint();
sc.addAuthRole(serverPermittedRole);
sc.addCollection(collection);
diff --git a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
index 0c4efbcc73..59537ac396 100644
--- a/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
+++ b/test/org/apache/catalina/authenticator/TestFormAuthenticatorA.java
@@ -594,18 +594,18 @@ public class TestFormAuthenticatorA extends TomcatBaseTest {
Context ctx = tomcat.addContext("", System.getProperty("java.io.tmpdir"));
Tomcat.addServlet(ctx, "SelectedMethods", new SelectedMethodsServlet());
- ctx.addServletMappingDecoded("/test", "SelectedMethods");
+ ctx.addServletMapping("/test", "SelectedMethods");
// Login servlet just needs to respond "OK". Client will handle
// creating a valid response. No need for a form.
Tomcat.addServlet(ctx, "Login", new TesterServlet());
- ctx.addServletMappingDecoded("/login", "Login");
+ ctx.addServletMapping("/login", "Login");
// Configure the security constraints
SecurityConstraint constraint = new SecurityConstraint();
SecurityCollection collection = new SecurityCollection();
collection.setName("Protect PUT");
collection.addMethod(Method.PUT);
- collection.addPatternDecoded("/test");
+ collection.addPattern("/test");
constraint.addCollection(collection);
constraint.addAuthRole("tomcat");
ctx.addConstraint(constraint);
diff --git a/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java b/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java
index d731185afe..698b2bd3a7 100644
--- a/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java
+++ b/test/org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java
@@ -395,10 +395,10 @@ public class TestNonLoginAndBasicAuthenticator extends TomcatBaseTest {
// Add protected servlet to the context
Tomcat.addServlet(nonloginContext, "TesterServlet1", new TesterServlet());
- nonloginContext.addServletMappingDecoded(URI_PROTECTED, "TesterServlet1");
+ nonloginContext.addServletMapping(URI_PROTECTED, "TesterServlet1");
SecurityCollection collection1 = new SecurityCollection();
- collection1.addPatternDecoded(URI_PROTECTED);
+ collection1.addPattern(URI_PROTECTED);
SecurityConstraint sc1 = new SecurityConstraint();
sc1.addAuthRole(ROLE);
sc1.addCollection(collection1);
@@ -406,10 +406,10 @@ public class TestNonLoginAndBasicAuthenticator extends TomcatBaseTest {
// Add unprotected servlet to the context
Tomcat.addServlet(nonloginContext, "TesterServlet2", new TesterServlet());
- nonloginContext.addServletMappingDecoded(URI_PUBLIC, "TesterServlet2");
+ nonloginContext.addServletMapping(URI_PUBLIC, "TesterServlet2");
SecurityCollection collection2 = new SecurityCollection();
- collection2.addPatternDecoded(URI_PUBLIC);
+ collection2.addPattern(URI_PUBLIC);
SecurityConstraint sc2 = new SecurityConstraint();
// do not add a role - which signals access permitted without one
sc2.addCollection(collection2);
@@ -430,9 +430,9 @@ public class TestNonLoginAndBasicAuthenticator extends TomcatBaseTest {
// Add protected servlet to the context
Tomcat.addServlet(basicContext, "TesterServlet3", new TesterServlet());
- basicContext.addServletMappingDecoded(URI_PROTECTED, "TesterServlet3");
+ basicContext.addServletMapping(URI_PROTECTED, "TesterServlet3");
SecurityCollection collection = new SecurityCollection();
- collection.addPatternDecoded(URI_PROTECTED);
+ collection.addPattern(URI_PROTECTED);
SecurityConstraint sc = new SecurityConstraint();
sc.addAuthRole(ROLE);
sc.addCollection(collection);
@@ -440,10 +440,10 @@ public class TestNonLoginAndBasicAuthenticator extends TomcatBaseTest {
// Add unprotected servlet to the context
Tomcat.addServlet(basicContext, "TesterServlet4", new TesterServlet());
- basicContext.addServletMappingDecoded(URI_PUBLIC, "TesterServlet4");
+ basicContext.addServletMapping(URI_PUBLIC, "TesterServlet4");
SecurityCollection collection2 = new SecurityCollection();
- collection2.addPatternDecoded(URI_PUBLIC);
+ collection2.addPattern(URI_PUBLIC);
SecurityConstraint sc2 = new SecurityConstraint();
// do not add a role - which signals access permitted without one
sc2.addCollection(collection2);
diff --git a/test/org/apache/catalina/authenticator/TestSSOChangeSessionId.java b/test/org/apache/catalina/authenticator/TestSSOChangeSessionId.java
index 48746458ba..7a0510ac71 100644
--- a/test/org/apache/catalina/authenticator/TestSSOChangeSessionId.java
+++ b/test/org/apache/catalina/authenticator/TestSSOChangeSessionId.java
@@ -92,10 +92,10 @@ public class TestSSOChangeSessionId extends TomcatBaseTest {
// Add protected servlet to the context
Tomcat.addServlet(testContext, "TesterServlet1", new TesterServlet());
- testContext.addServletMappingDecoded(URI_PROTECTED, "TesterServlet1");
+ testContext.addServletMapping(URI_PROTECTED, "TesterServlet1");
SecurityCollection collection1 = new SecurityCollection();
- collection1.addPatternDecoded(URI_PROTECTED);
+ collection1.addPattern(URI_PROTECTED);
SecurityConstraint sc1 = new SecurityConstraint();
sc1.addAuthRole(ROLE);
sc1.addCollection(collection1);
@@ -103,10 +103,10 @@ public class TestSSOChangeSessionId extends TomcatBaseTest {
// Add Authenticator
Tomcat.addServlet(testContext, "LoginServlet", new LoginServlet());
- testContext.addServletMappingDecoded(URI_AUTHENTICATION, "LoginServlet");
+ testContext.addServletMapping(URI_AUTHENTICATION, "LoginServlet");
SecurityCollection collection2 = new SecurityCollection();
- collection2.addPatternDecoded(URI_AUTHENTICATION);
+ collection2.addPattern(URI_AUTHENTICATION);
SecurityConstraint sc2 = new SecurityConstraint();
// do not add a role - which signals access permitted without one
sc2.addCollection(collection2);
diff --git a/test/org/apache/catalina/authenticator/TestSSOnonLoginAndBasicAuthenticator.java b/test/org/apache/catalina/authenticator/TestSSOnonLoginAndBasicAuthenticator.java
index 20e65ab3e5..2d85b4ba57 100644
--- a/test/org/apache/catalina/authenticator/TestSSOnonLoginAndBasicAuthenticator.java
+++ b/test/org/apache/catalina/authenticator/TestSSOnonLoginAndBasicAuthenticator.java
@@ -407,10 +407,10 @@ public class TestSSOnonLoginAndBasicAuthenticator extends TomcatBaseTest {
// Add protected servlet to the context
Tomcat.addServlet(nonloginContext, "TesterServlet1", new TesterServletEncodeUrl());
- nonloginContext.addServletMappingDecoded(URI_PROTECTED, "TesterServlet1");
+ nonloginContext.addServletMapping(URI_PROTECTED, "TesterServlet1");
SecurityCollection collection1 = new SecurityCollection();
- collection1.addPatternDecoded(URI_PROTECTED);
+ collection1.addPattern(URI_PROTECTED);
SecurityConstraint sc1 = new SecurityConstraint();
sc1.addAuthRole(ROLE);
sc1.addCollection(collection1);
@@ -418,10 +418,10 @@ public class TestSSOnonLoginAndBasicAuthenticator extends TomcatBaseTest {
// Add unprotected servlet to the context
Tomcat.addServlet(nonloginContext, "TesterServlet2", new TesterServletEncodeUrl());
- nonloginContext.addServletMappingDecoded(URI_PUBLIC, "TesterServlet2");
+ nonloginContext.addServletMapping(URI_PUBLIC, "TesterServlet2");
SecurityCollection collection2 = new SecurityCollection();
- collection2.addPatternDecoded(URI_PUBLIC);
+ collection2.addPattern(URI_PUBLIC);
SecurityConstraint sc2 = new SecurityConstraint();
// do not add a role - which signals access permitted without one
sc2.addCollection(collection2);
@@ -443,9 +443,9 @@ public class TestSSOnonLoginAndBasicAuthenticator extends TomcatBaseTest {
// Add protected servlet to the context
Tomcat.addServlet(basicContext, "TesterServlet3", new TesterServletEncodeUrl());
- basicContext.addServletMappingDecoded(URI_PROTECTED, "TesterServlet3");
+ basicContext.addServletMapping(URI_PROTECTED, "TesterServlet3");
SecurityCollection collection = new SecurityCollection();
- collection.addPatternDecoded(URI_PROTECTED);
+ collection.addPattern(URI_PROTECTED);
SecurityConstraint sc = new SecurityConstraint();
sc.addAuthRole(ROLE);
sc.addCollection(collection);
@@ -453,9 +453,9 @@ public class TestSSOnonLoginAndBasicAuthenticator extends TomcatBaseTest {
// Add unprotected servlet to the context
Tomcat.addServlet(basicContext, "TesterServlet4", new TesterServletEncodeUrl());
- basicContext.addServletMappingDecoded(URI_PUBLIC, "TesterServlet4");
+ basicContext.addServletMapping(URI_PUBLIC, "TesterServlet4");
SecurityCollection collection2 = new SecurityCollection();
- collection2.addPatternDecoded(URI_PUBLIC);
+ collection2.addPattern(URI_PUBLIC);
SecurityConstraint sc2 = new SecurityConstraint();
// do not add a role - which signals access permitted without one
sc2.addCollection(collection2);
diff --git a/test/org/apache/catalina/authenticator/TestSSOnonLoginAndDigestAuthenticator.java b/test/org/apache/catalina/authenticator/TestSSOnonLoginAndDigestAuthenticator.java
index dffb97ad2c..659dd3b4b0 100644
--- a/test/org/apache/catalina/authenticator/TestSSOnonLoginAndDigestAuthenticator.java
+++ b/test/org/apache/catalina/authenticator/TestSSOnonLoginAndDigestAuthenticator.java
@@ -276,9 +276,9 @@ public class TestSSOnonLoginAndDigestAuthenticator extends TomcatBaseTest {
// Add protected servlet
Tomcat.addServlet(ctxt, "TesterServlet1", new TesterServlet());
- ctxt.addServletMappingDecoded(URI_PROTECTED, "TesterServlet1");
+ ctxt.addServletMapping(URI_PROTECTED, "TesterServlet1");
SecurityCollection collection1 = new SecurityCollection();
- collection1.addPatternDecoded(URI_PROTECTED);
+ collection1.addPattern(URI_PROTECTED);
SecurityConstraint sc1 = new SecurityConstraint();
sc1.addAuthRole(ROLE);
sc1.addCollection(collection1);
@@ -286,9 +286,9 @@ public class TestSSOnonLoginAndDigestAuthenticator extends TomcatBaseTest {
// Add unprotected servlet
Tomcat.addServlet(ctxt, "TesterServlet2", new TesterServlet());
- ctxt.addServletMappingDecoded(URI_PUBLIC, "TesterServlet2");
+ ctxt.addServletMapping(URI_PUBLIC, "TesterServlet2");
SecurityCollection collection2 = new SecurityCollection();
- collection2.addPatternDecoded(URI_PUBLIC);
+ collection2.addPattern(URI_PUBLIC);
SecurityConstraint sc2 = new SecurityConstraint();
// do not add a role - which signals access permitted without one
sc2.addCollection(collection2);
@@ -309,9 +309,9 @@ public class TestSSOnonLoginAndDigestAuthenticator extends TomcatBaseTest {
// Add protected servlet
Tomcat.addServlet(ctxt, "TesterServlet3", new TesterServlet());
- ctxt.addServletMappingDecoded(URI_PROTECTED, "TesterServlet3");
+ ctxt.addServletMapping(URI_PROTECTED, "TesterServlet3");
SecurityCollection collection = new SecurityCollection();
- collection.addPatternDecoded(URI_PROTECTED);
+ collection.addPattern(URI_PROTECTED);
SecurityConstraint sc = new SecurityConstraint();
sc.addAuthRole(ROLE);
sc.addCollection(collection);
diff --git a/test/org/apache/catalina/connector/TestClientReadTimeout.java b/test/org/apache/catalina/connector/TestClientReadTimeout.java
index 9342249ab0..2ceaa2ee84 100644
--- a/test/org/apache/catalina/connector/TestClientReadTimeout.java
+++ b/test/org/apache/catalina/connector/TestClientReadTimeout.java
@@ -55,7 +55,7 @@ public class TestClientReadTimeout extends TomcatBaseTest {
((StandardHost) tomcat.getHost()).setErrorReportValveClass(null);
Tomcat.addServlet(ctx, "TestServlet", new SyncServlet());
- ctx.addServletMappingDecoded("/*", "TestServlet");
+ ctx.addServletMapping("/*", "TestServlet");
tomcat.start();
diff --git a/test/org/apache/catalina/connector/TestConnector.java b/test/org/apache/catalina/connector/TestConnector.java
index 91ec3a08b0..9d8d3ce460 100644
--- a/test/org/apache/catalina/connector/TestConnector.java
+++ b/test/org/apache/catalina/connector/TestConnector.java
@@ -51,7 +51,7 @@ public class TestConnector extends TomcatBaseTest {
Context root = tomcat.addContext("", TEMP_DIR);
Wrapper w = Tomcat.addServlet(root, "tester", new TesterServlet());
w.setAsyncSupported(true);
- root.addServletMappingDecoded("/", "tester");
+ root.addServletMapping("/", "tester");
Connector connector = tomcat.getConnector();
@@ -189,7 +189,7 @@ public class TestConnector extends TomcatBaseTest {
File appDir = new File("test/webapp");
Context root = tomcat.addContext("", appDir.getAbsolutePath());
Tomcat.addServlet(root, "default", servlet);
- root.addServletMappingDecoded("/", "default");
+ root.addServletMapping("/", "default");
Connector connector = tomcat.getConnector();
connector.setAllowTrace(allowTrace);
@@ -249,7 +249,7 @@ public class TestConnector extends TomcatBaseTest {
Context root = getProgrammaticRootContext();
Tomcat.addServlet(root, "default", new TesterServlet());
- root.addServletMappingDecoded("/", "default");
+ root.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/catalina/connector/TestCoyoteAdapter.java b/test/org/apache/catalina/connector/TestCoyoteAdapter.java
index 76a8d9058b..a1f7df4fc9 100644
--- a/test/org/apache/catalina/connector/TestCoyoteAdapter.java
+++ b/test/org/apache/catalina/connector/TestCoyoteAdapter.java
@@ -117,7 +117,7 @@ public class TestCoyoteAdapter extends TomcatBaseTest {
Context ctx = tomcat.addContext("", docBase.getAbsolutePath());
Tomcat.addServlet(ctx, "servlet", new PathParamServlet());
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
@@ -138,7 +138,7 @@ public class TestCoyoteAdapter extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "servlet", new PathParamServlet());
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
@@ -189,7 +189,7 @@ public class TestCoyoteAdapter extends TomcatBaseTest {
Context ctx = tomcat.addContext("/testapp", null);
Tomcat.addServlet(ctx, "servlet", new PathParamServlet());
- ctx.addServletMappingDecoded("*.txt", "servlet");
+ ctx.addServletMapping("*.txt", "servlet");
tomcat.start();
@@ -239,7 +239,7 @@ public class TestCoyoteAdapter extends TomcatBaseTest {
PathInfoServlet servlet = new PathInfoServlet();
Tomcat.addServlet(ctx, "servlet", servlet);
- ctx.addServletMappingDecoded("/*", "servlet");
+ ctx.addServletMapping("/*", "servlet");
tomcat.start();
@@ -280,7 +280,7 @@ public class TestCoyoteAdapter extends TomcatBaseTest {
AsyncServlet servlet = new AsyncServlet();
Wrapper w = Tomcat.addServlet(ctx, "async", servlet);
w.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/async", "async");
+ ctx.addServletMapping("/async", "async");
tomcat.start();
diff --git a/test/org/apache/catalina/connector/TestCoyoteAdapterRequestFuzzing.java b/test/org/apache/catalina/connector/TestCoyoteAdapterRequestFuzzing.java
index f014340253..8592ace869 100644
--- a/test/org/apache/catalina/connector/TestCoyoteAdapterRequestFuzzing.java
+++ b/test/org/apache/catalina/connector/TestCoyoteAdapterRequestFuzzing.java
@@ -117,7 +117,7 @@ public class TestCoyoteAdapterRequestFuzzing extends TomcatBaseTest {
File appDir = new File("test/webapp");
Context ctxt = tomcat.addContext("", appDir.getAbsolutePath());
Tomcat.addServlet(ctxt, "default", DefaultServlet.class.getName());
- ctxt.addServletMappingDecoded("/", "default");
+ ctxt.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/catalina/connector/TestCoyoteInputStream.java b/test/org/apache/catalina/connector/TestCoyoteInputStream.java
index 1575470949..9eea38456a 100644
--- a/test/org/apache/catalina/connector/TestCoyoteInputStream.java
+++ b/test/org/apache/catalina/connector/TestCoyoteInputStream.java
@@ -41,7 +41,7 @@ public class TestCoyoteInputStream extends TomcatBaseTest {
Context root = tomcat.addContext("", TEMP_DIR);
Tomcat.addServlet(root, "testServlet", new TestServlet());
- root.addServletMappingDecoded("/", "testServlet");
+ root.addServletMapping("/", "testServlet");
tomcat.start();
diff --git a/test/org/apache/catalina/connector/TestCoyoteOutputStream.java b/test/org/apache/catalina/connector/TestCoyoteOutputStream.java
index a62368a25f..26f52d62d9 100644
--- a/test/org/apache/catalina/connector/TestCoyoteOutputStream.java
+++ b/test/org/apache/catalina/connector/TestCoyoteOutputStream.java
@@ -108,7 +108,7 @@ public class TestCoyoteOutputStream extends TomcatBaseTest {
Context root = tomcat.addContext("", TEMP_DIR);
Tomcat.addServlet(root, "testServlet", new TestServlet());
- root.addServletMappingDecoded("/", "testServlet");
+ root.addServletMapping("/", "testServlet");
tomcat.start();
@@ -132,10 +132,10 @@ public class TestCoyoteOutputStream extends TomcatBaseTest {
Wrapper w = Tomcat.addServlet(root, "nbWrite",
new NonBlockingWriteServlet(asyncWriteTarget, useContainerThreadToSetListener));
w.setAsyncSupported(true);
- root.addServletMappingDecoded("/nbWrite", "nbWrite");
+ root.addServletMapping("/nbWrite", "nbWrite");
Tomcat.addServlet(root, "write", new BlockingWriteServlet(asyncWriteTarget, syncWriteTarget));
w.setAsyncSupported(true);
- root.addServletMappingDecoded("/write", "write");
+ root.addServletMapping("/write", "write");
tomcat.start();
diff --git a/test/org/apache/catalina/connector/TestInputBuffer.java b/test/org/apache/catalina/connector/TestInputBuffer.java
index 6796005411..5c8f3c23ea 100644
--- a/test/org/apache/catalina/connector/TestInputBuffer.java
+++ b/test/org/apache/catalina/connector/TestInputBuffer.java
@@ -46,7 +46,7 @@ public class TestInputBuffer extends TomcatBaseTest {
Tomcat tomcat = getTomcatInstance();
Context root = tomcat.addContext("", TEMP_DIR);
Tomcat.addServlet(root, "Echo", new Utf8Echo());
- root.addServletMappingDecoded("/test", "Echo");
+ root.addServletMapping("/test", "Echo");
tomcat.start();
@@ -65,7 +65,7 @@ public class TestInputBuffer extends TomcatBaseTest {
Tomcat tomcat = getTomcatInstance();
Context root = tomcat.addContext("", TEMP_DIR);
Tomcat.addServlet(root, "Bug60400Servlet", new Bug60400Servlet());
- root.addServletMappingDecoded("/", "Bug60400Servlet");
+ root.addServletMapping("/", "Bug60400Servlet");
Assert.assertTrue(tomcat.getConnector().setProperty("socket.appReadBufSize", "9000"));
tomcat.start();
@@ -84,7 +84,7 @@ public class TestInputBuffer extends TomcatBaseTest {
Tomcat tomcat = getTomcatInstance();
Context root = tomcat.addContext("", TEMP_DIR);
Tomcat.addServlet(root, "Echo", new Utf8Echo());
- root.addServletMappingDecoded("/test", "Echo");
+ root.addServletMapping("/test", "Echo");
Assert.assertTrue(tomcat.getConnector().setProperty("socket.appReadBufSize", "10500"));
diff --git a/test/org/apache/catalina/connector/TestKeepAliveCount.java b/test/org/apache/catalina/connector/TestKeepAliveCount.java
index 8c15f255e9..f9e32a680f 100644
--- a/test/org/apache/catalina/connector/TestKeepAliveCount.java
+++ b/test/org/apache/catalina/connector/TestKeepAliveCount.java
@@ -59,7 +59,7 @@ public class TestKeepAliveCount extends TomcatBaseTest {
Tomcat tomcat = getTomcatInstance();
Context root = tomcat.addContext("", TEMP_DIR);
Tomcat.addServlet(root, "Simple", new SimpleServlet());
- root.addServletMappingDecoded("/test", "Simple");
+ root.addServletMapping("/test", "Simple");
Assert.assertTrue(tomcat.getConnector().setProperty("maxKeepAliveRequests", "5"));
Assert.assertTrue(tomcat.getConnector().setProperty("connectionTimeout", "20000"));
Assert.assertTrue(tomcat.getConnector().setProperty("keepAliveTimeout", "50000"));
diff --git a/test/org/apache/catalina/connector/TestMaxConnections.java b/test/org/apache/catalina/connector/TestMaxConnections.java
index caa058f4b3..963aa0f49a 100644
--- a/test/org/apache/catalina/connector/TestMaxConnections.java
+++ b/test/org/apache/catalina/connector/TestMaxConnections.java
@@ -73,7 +73,7 @@ public class TestMaxConnections extends TomcatBaseTest {
StandardContext root = (StandardContext) tomcat.addContext("", SimpleHttpClient.TEMP_DIR);
root.setUnloadDelay(soTimeout);
Tomcat.addServlet(root, "Simple", new SimpleServlet());
- root.addServletMappingDecoded("/test", "Simple");
+ root.addServletMapping("/test", "Simple");
Assert.assertTrue(tomcat.getConnector().setProperty("maxKeepAliveRequests", "1"));
Assert.assertTrue(tomcat.getConnector().setProperty("maxThreads", "10"));
Assert.assertTrue(tomcat.getConnector().setProperty("connectionTimeout", "20000"));
diff --git a/test/org/apache/catalina/connector/TestOutputBuffer.java b/test/org/apache/catalina/connector/TestOutputBuffer.java
index 0ea11fe119..8f044238fc 100644
--- a/test/org/apache/catalina/connector/TestOutputBuffer.java
+++ b/test/org/apache/catalina/connector/TestOutputBuffer.java
@@ -51,7 +51,7 @@ public class TestOutputBuffer extends TomcatBaseTest {
for (int i = 1; i <= WritingServlet.EXPECTED_CONTENT_LENGTH; i *= 10) {
WritingServlet servlet = new WritingServlet(i);
Tomcat.addServlet(root, "servlet" + i, servlet);
- root.addServletMappingDecoded("/servlet" + i, "servlet" + i);
+ root.addServletMapping("/servlet" + i, "servlet" + i);
}
tomcat.start();
@@ -81,7 +81,7 @@ public class TestOutputBuffer extends TomcatBaseTest {
Bug52577Servlet bug52577 = new Bug52577Servlet();
Tomcat.addServlet(root, "bug52577", bug52577);
- root.addServletMappingDecoded("/", "bug52577");
+ root.addServletMapping("/", "bug52577");
tomcat.start();
@@ -168,7 +168,7 @@ public class TestOutputBuffer extends TomcatBaseTest {
Tomcat tomcat = getTomcatInstance();
Context root = tomcat.addContext("", TEMP_DIR);
Tomcat.addServlet(root, "Test", new Utf8WriteChars(data));
- root.addServletMappingDecoded("/test", "Test");
+ root.addServletMapping("/test", "Test");
tomcat.start();
diff --git a/test/org/apache/catalina/connector/TestRequest.java b/test/org/apache/catalina/connector/TestRequest.java
index 39ab4ca130..82a17e4f8c 100644
--- a/test/org/apache/catalina/connector/TestRequest.java
+++ b/test/org/apache/catalina/connector/TestRequest.java
@@ -171,7 +171,7 @@ public class TestRequest extends TomcatBaseTest {
Tomcat tomcat = getTomcatInstance();
Context root = tomcat.addContext("", TEMP_DIR);
Tomcat.addServlet(root, "Bug37794", new Bug37794Servlet());
- root.addServletMappingDecoded("/test", "Bug37794");
+ root.addServletMapping("/test", "Bug37794");
if (createFilter) {
FilterDef failedRequestFilter = new FilterDef();
@@ -276,7 +276,7 @@ public class TestRequest extends TomcatBaseTest {
// Add the Servlet
Tomcat.addServlet(ctx, "servlet", new EchoQueryStringServlet());
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
@@ -322,7 +322,7 @@ public class TestRequest extends TomcatBaseTest {
ctx.getPipeline().addValve(new BasicAuthenticator());
Tomcat.addServlet(ctx, "servlet", new LoginLogoutServlet());
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
TesterMapRealm realm = new TesterMapRealm();
realm.addUser(LoginLogoutServlet.USER, LoginLogoutServlet.PWD);
@@ -371,7 +371,7 @@ public class TestRequest extends TomcatBaseTest {
Tomcat tomcat = getTomcatInstance();
Context root = tomcat.addContext("", System.getProperty("java.io.tmpdir"));
Tomcat.addServlet(root, "Bug37794", new Bug37794Servlet());
- root.addServletMappingDecoded("/", "Bug37794");
+ root.addServletMapping("/", "Bug37794");
tomcat.start();
HttpURLConnection conn = getConnection("http://localhost:" + getPort() + "/");
@@ -384,7 +384,7 @@ public class TestRequest extends TomcatBaseTest {
Tomcat tomcat = getTomcatInstance();
Context root = tomcat.addContext("", System.getProperty("java.io.tmpdir"));
Tomcat.addServlet(root, "Bug37794", new Bug37794Servlet());
- root.addServletMappingDecoded("/", "Bug37794");
+ root.addServletMapping("/", "Bug37794");
tomcat.start();
HttpURLConnection conn = getConnection("http://localhost:" + getPort() + "/");
@@ -453,7 +453,7 @@ public class TestRequest extends TomcatBaseTest {
Context root = tomcat.addContext("", System.getProperty("java.io.tmpdir"));
root.setAllowCasualMultipartParsing(true);
Tomcat.addServlet(root, "Bug54984", new Bug54984Servlet());
- root.addServletMappingDecoded("/", "Bug54984");
+ root.addServletMapping("/", "Bug54984");
tomcat.start();
HttpURLConnection conn = getConnection("http://localhost:" + getPort() + "/parseParametersBeforeParseParts");
@@ -528,7 +528,7 @@ public class TestRequest extends TomcatBaseTest {
Tomcat tomcat = getTomcatInstance();
Context root = tomcat.addContext("", TEMP_DIR);
Tomcat.addServlet(root, "EchoParameters", new EchoParametersServlet());
- root.addServletMappingDecoded("/echo", "EchoParameters");
+ root.addServletMapping("/echo", "EchoParameters");
tomcat.start();
setPort(tomcat.getConnector().getLocalPort());
@@ -802,7 +802,7 @@ public class TestRequest extends TomcatBaseTest {
ctx.setAllowMultipleLeadingForwardSlashInPath(true);
Tomcat.addServlet(ctx, "servlet", new Bug56501Servlet());
- ctx.addServletMappingDecoded("/*", "servlet");
+ ctx.addServletMapping("/*", "servlet");
tomcat.start();
@@ -876,7 +876,7 @@ public class TestRequest extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "servlet", new Bug61264GetReaderServlet());
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
@@ -947,7 +947,7 @@ public class TestRequest extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "servlet", new Bug69442Servlet());
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
diff --git a/test/org/apache/catalina/connector/TestResponse.java b/test/org/apache/catalina/connector/TestResponse.java
index ddcf9b8f5f..98649fe66d 100644
--- a/test/org/apache/catalina/connector/TestResponse.java
+++ b/test/org/apache/catalina/connector/TestResponse.java
@@ -56,7 +56,7 @@ public class TestResponse extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "servlet", new Bug49598Servlet());
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
@@ -110,7 +110,7 @@ public class TestResponse extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "servlet", new CharsetServlet());
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
@@ -148,7 +148,7 @@ public class TestResponse extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "servlet", new Bug52811Servlet());
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
@@ -973,7 +973,7 @@ public class TestResponse extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "servlet", new ErrorPageServlet());
- ctx.addServletMappingDecoded("/error", "servlet");
+ ctx.addServletMapping("/error", "servlet");
ErrorPage servletErrorPage = new ErrorPage();
servletErrorPage.setErrorCode(404);
servletErrorPage.setLocation("/error");
diff --git a/test/org/apache/catalina/connector/TestSendFile.java b/test/org/apache/catalina/connector/TestSendFile.java
index e93d4c88eb..661651d919 100644
--- a/test/org/apache/catalina/connector/TestSendFile.java
+++ b/test/org/apache/catalina/connector/TestSendFile.java
@@ -66,7 +66,7 @@ public class TestSendFile extends TomcatBaseTest {
for (int i = 0; i < ITERATIONS; i++) {
WritingServlet servlet = new WritingServlet(files[i]);
Tomcat.addServlet(root, "servlet" + i, servlet);
- root.addServletMappingDecoded("/servlet" + i, "servlet" + i);
+ root.addServletMapping("/servlet" + i, "servlet" + i);
}
tomcat.start();
@@ -154,7 +154,7 @@ public class TestSendFile extends TomcatBaseTest {
Context ctx = tomcat.addContext("", TEMP_DIR);
File file = generateFile(TEMP_DIR, "", EXPECTED_CONTENT_LENGTH);
Tomcat.addServlet(ctx, "test", new Bug60409Servlet(file));
- ctx.addServletMappingDecoded("/", "test");
+ ctx.addServletMapping("/", "test");
tomcat.start();
diff --git a/test/org/apache/catalina/connector/TestValidateClientSessionId.java b/test/org/apache/catalina/connector/TestValidateClientSessionId.java
index 7abc65fba4..c5e7bc1b30 100644
--- a/test/org/apache/catalina/connector/TestValidateClientSessionId.java
+++ b/test/org/apache/catalina/connector/TestValidateClientSessionId.java
@@ -38,7 +38,7 @@ public class TestValidateClientSessionId extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "snoop", new SnoopServlet());
- ctx.addServletMappingDecoded("/", "snoop");
+ ctx.addServletMapping("/", "snoop");
tomcat.start();
@@ -61,12 +61,12 @@ public class TestValidateClientSessionId extends TomcatBaseTest {
Context ctx1 = tomcat.addContext("/app1", null);
ctx1.setSessionCookiePath("/");
Tomcat.addServlet(ctx1, "snoop", new SnoopServlet());
- ctx1.addServletMappingDecoded("/", "snoop");
+ ctx1.addServletMapping("/", "snoop");
Context ctx2 = tomcat.addContext("/app2", null);
ctx2.setSessionCookiePath("/");
Tomcat.addServlet(ctx2, "snoop", new SnoopServlet());
- ctx2.addServletMappingDecoded("/", "snoop");
+ ctx2.addServletMapping("/", "snoop");
tomcat.start();
diff --git a/test/org/apache/catalina/core/TestApplicationContext.java b/test/org/apache/catalina/core/TestApplicationContext.java
index 5fed927d47..dfc7e9ed55 100644
--- a/test/org/apache/catalina/core/TestApplicationContext.java
+++ b/test/org/apache/catalina/core/TestApplicationContext.java
@@ -182,7 +182,7 @@ public class TestApplicationContext extends TomcatBaseTest {
ctx.setCrossContext(true);
Tomcat.addServlet(ctx, "Bug57190Servlet", new Bug57190Servlet());
- ctx.addServletMappingDecoded("/", "Bug57190Servlet");
+ ctx.addServletMapping("/", "Bug57190Servlet");
tomcat.start();
@@ -253,14 +253,14 @@ public class TestApplicationContext extends TomcatBaseTest {
Context ctx2 = tomcat.addContext("/second", null);
GetAttributeServlet getAttributeServlet = new GetAttributeServlet();
Tomcat.addServlet(ctx2, "getAttributeServlet", getAttributeServlet);
- ctx2.addServletMappingDecoded("/test", "getAttributeServlet");
+ ctx2.addServletMapping("/test", "getAttributeServlet");
// No file system docBase required
Context ctx1 = tomcat.addContext("/first", null);
ctx1.setCrossContext(true);
SetAttributeServlet setAttributeServlet = new SetAttributeServlet("/test", "/second");
Tomcat.addServlet(ctx1, "setAttributeServlet", setAttributeServlet);
- ctx1.addServletMappingDecoded("/test", "setAttributeServlet");
+ ctx1.addServletMapping("/test", "setAttributeServlet");
tomcat.start();
diff --git a/test/org/apache/catalina/core/TestApplicationContextGetRequestDispatcher.java b/test/org/apache/catalina/core/TestApplicationContextGetRequestDispatcher.java
index 9237829a50..a15133d400 100644
--- a/test/org/apache/catalina/core/TestApplicationContextGetRequestDispatcher.java
+++ b/test/org/apache/catalina/core/TestApplicationContextGetRequestDispatcher.java
@@ -361,11 +361,11 @@ public class TestApplicationContextGetRequestDispatcher extends TomcatBaseTest {
// Add a default servlet to return 404 for not found resources
Tomcat.addServlet(ctx, "Default", new Default404Servlet());
- ctx.addServletMappingDecoded("/", "Default");
+ ctx.addServletMapping("/", "Default");
// Add a target servlet to dispatch to
Tomcat.addServlet(ctx, "target", new TargetServlet());
- ctx.addServletMappingDecoded(UDecoder.URLDecode(targetPath, StandardCharsets.UTF_8), "target");
+ ctx.addServletMapping(UDecoder.URLDecode(targetPath, StandardCharsets.UTF_8), "target");
if (useAsync) {
Wrapper w = Tomcat.addServlet(ctx, "rd", new AsyncDispatcherServlet(dispatchPath, useEncodedDispatchPaths));
@@ -373,7 +373,7 @@ public class TestApplicationContextGetRequestDispatcher extends TomcatBaseTest {
} else {
Tomcat.addServlet(ctx, "rd", new DispatcherServlet(dispatchPath));
}
- ctx.addServletMappingDecoded(UDecoder.URLDecode(startPath, StandardCharsets.UTF_8), "rd");
+ ctx.addServletMapping(UDecoder.URLDecode(startPath, StandardCharsets.UTF_8), "rd");
tomcat.start();
diff --git a/test/org/apache/catalina/core/TestApplicationContextGetRequestDispatcherB.java b/test/org/apache/catalina/core/TestApplicationContextGetRequestDispatcherB.java
index 322c8d34b6..f0547cc55e 100644
--- a/test/org/apache/catalina/core/TestApplicationContextGetRequestDispatcherB.java
+++ b/test/org/apache/catalina/core/TestApplicationContextGetRequestDispatcherB.java
@@ -333,11 +333,11 @@ public class TestApplicationContextGetRequestDispatcherB extends TomcatBaseTest
// Add a target servlet to dispatch to
Tomcat.addServlet(ctx, "target", new Target());
- ctx.addServletMappingDecoded(targetMapping, "target");
+ ctx.addServletMapping(targetMapping, "target");
Wrapper w = Tomcat.addServlet(ctx, "rd", new Dispatch());
w.setAsyncSupported(true);
- ctx.addServletMappingDecoded(startMapping, "rd");
+ ctx.addServletMapping(startMapping, "rd");
tomcat.start();
diff --git a/test/org/apache/catalina/core/TestApplicationContextGetRequestDispatcherC.java b/test/org/apache/catalina/core/TestApplicationContextGetRequestDispatcherC.java
index 130ef3cf08..0042300e18 100644
--- a/test/org/apache/catalina/core/TestApplicationContextGetRequestDispatcherC.java
+++ b/test/org/apache/catalina/core/TestApplicationContextGetRequestDispatcherC.java
@@ -96,11 +96,11 @@ public class TestApplicationContextGetRequestDispatcherC extends TomcatBaseTest
// Servlet that performs a dispatch to ...
Tomcat.addServlet(ctx, "rd", new Dispatch(pathInfoRequest));
- ctx.addServletMappingDecoded("/dispatch/*", "rd");
+ ctx.addServletMapping("/dispatch/*", "rd");
// ... this Servlet
Tomcat.addServlet(ctx, "target", new Target());
- ctx.addServletMappingDecoded("/target/*", "target");
+ ctx.addServletMapping("/target/*", "target");
tomcat.start();
diff --git a/test/org/apache/catalina/core/TestApplicationFilterConfig.java b/test/org/apache/catalina/core/TestApplicationFilterConfig.java
index 22aa2a0334..5452737ec0 100644
--- a/test/org/apache/catalina/core/TestApplicationFilterConfig.java
+++ b/test/org/apache/catalina/core/TestApplicationFilterConfig.java
@@ -41,7 +41,7 @@ public class TestApplicationFilterConfig extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "HelloWorld", new HelloWorldServlet());
- ctx.addServletMappingDecoded("/", "HelloWorld");
+ ctx.addServletMapping("/", "HelloWorld");
// Add a filter with a name that should be escaped if used in a JMX
// object name
diff --git a/test/org/apache/catalina/core/TestApplicationHttpRequest.java b/test/org/apache/catalina/core/TestApplicationHttpRequest.java
index 6cac1091f1..88e6d92796 100644
--- a/test/org/apache/catalina/core/TestApplicationHttpRequest.java
+++ b/test/org/apache/catalina/core/TestApplicationHttpRequest.java
@@ -190,10 +190,10 @@ public class TestApplicationHttpRequest extends TomcatBaseTest {
} else {
Tomcat.addServlet(ctx, "forward", new ForwardServlet("/display?" + forwardQueryString));
}
- ctx.addServletMappingDecoded("/forward", "forward");
+ ctx.addServletMapping("/forward", "forward");
Tomcat.addServlet(ctx, "display", new DisplayParameterServlet(expected));
- ctx.addServletMappingDecoded("/display", "display");
+ ctx.addServletMapping("/display", "display");
tomcat.start();
@@ -243,10 +243,10 @@ public class TestApplicationHttpRequest extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "forward", new ForwardServlet("/modify"));
- ctx.addServletMappingDecoded("/forward", "forward");
+ ctx.addServletMapping("/forward", "forward");
Tomcat.addServlet(ctx, "modify", new ModifyParameterServlet());
- ctx.addServletMappingDecoded("/modify", "modify");
+ ctx.addServletMapping("/modify", "modify");
tomcat.start();
diff --git a/test/org/apache/catalina/core/TestApplicationMapping.java b/test/org/apache/catalina/core/TestApplicationMapping.java
index 610ca3749e..dc402a1399 100644
--- a/test/org/apache/catalina/core/TestApplicationMapping.java
+++ b/test/org/apache/catalina/core/TestApplicationMapping.java
@@ -126,7 +126,7 @@ public class TestApplicationMapping extends TomcatBaseTest {
Context ctx = tomcat.addContext(contextPath, null);
Tomcat.addServlet(ctx, "Mapping", new MappingServlet());
- ctx.addServletMappingDecoded(mapping, "Mapping");
+ ctx.addServletMapping(mapping, "Mapping");
tomcat.start();
@@ -147,9 +147,9 @@ public class TestApplicationMapping extends TomcatBaseTest {
Context ctx = tomcat.addContext(contextPath, null);
Tomcat.addServlet(ctx, "Include", new IncludeServlet());
- ctx.addServletMappingDecoded(mapping, "Include");
+ ctx.addServletMapping(mapping, "Include");
Tomcat.addServlet(ctx, "Mapping", new MappingServlet());
- ctx.addServletMappingDecoded("/mapping", "Mapping");
+ ctx.addServletMapping("/mapping", "Mapping");
tomcat.start();
@@ -175,9 +175,9 @@ public class TestApplicationMapping extends TomcatBaseTest {
Context ctx = tomcat.addContext(contextPath, null);
Tomcat.addServlet(ctx, "Include", new NamedIncludeServlet());
- ctx.addServletMappingDecoded(mapping, "Include");
+ ctx.addServletMapping(mapping, "Include");
Tomcat.addServlet(ctx, "Mapping", new MappingServlet());
- ctx.addServletMappingDecoded("/mapping", "Mapping");
+ ctx.addServletMapping("/mapping", "Mapping");
tomcat.start();
@@ -198,9 +198,9 @@ public class TestApplicationMapping extends TomcatBaseTest {
Context ctx = tomcat.addContext(contextPath, null);
Tomcat.addServlet(ctx, "Forward", new ForwardServlet());
- ctx.addServletMappingDecoded(mapping, "Forward");
+ ctx.addServletMapping(mapping, "Forward");
Tomcat.addServlet(ctx, "Mapping", new MappingServlet());
- ctx.addServletMappingDecoded("/mapping", "Mapping");
+ ctx.addServletMapping("/mapping", "Mapping");
tomcat.start();
@@ -226,9 +226,9 @@ public class TestApplicationMapping extends TomcatBaseTest {
Context ctx = tomcat.addContext(contextPath, null);
Tomcat.addServlet(ctx, "Forward", new NamedForwardServlet());
- ctx.addServletMappingDecoded(mapping, "Forward");
+ ctx.addServletMapping(mapping, "Forward");
Tomcat.addServlet(ctx, "Mapping", new MappingServlet());
- ctx.addServletMappingDecoded("/mapping", "Mapping");
+ ctx.addServletMapping("/mapping", "Mapping");
tomcat.start();
@@ -250,9 +250,9 @@ public class TestApplicationMapping extends TomcatBaseTest {
Wrapper w = Tomcat.addServlet(ctx, "Async", new AsyncServlet());
w.setAsyncSupported(true);
- ctx.addServletMappingDecoded(mapping, "Async");
+ ctx.addServletMapping(mapping, "Async");
Tomcat.addServlet(ctx, "Mapping", new MappingServlet());
- ctx.addServletMappingDecoded("/mapping", "Mapping");
+ ctx.addServletMapping("/mapping", "Mapping");
tomcat.start();
diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java b/test/org/apache/catalina/core/TestAsyncContextImpl.java
index 37dc125239..afa1a704f8 100644
--- a/test/org/apache/catalina/core/TestAsyncContextImpl.java
+++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java
@@ -106,7 +106,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
Wrapper wrapper = Tomcat.addServlet(ctx, "servlet", servlet);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
TesterAccessLogValve alv = new TesterAccessLogValve();
ctx.getPipeline().addValve(alv);
@@ -143,7 +143,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
Wrapper wrapper = Tomcat.addServlet(ctx, "servlet", servlet);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
TesterAccessLogValve alv = new TesterAccessLogValve();
ctx.getPipeline().addValve(alv);
@@ -184,7 +184,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
Wrapper wrapper = Tomcat.addServlet(ctx, "servlet", servlet);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
TesterAccessLogValve alv = new TesterAccessLogValve();
ctx.getPipeline().addValve(alv);
@@ -220,7 +220,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
Wrapper wrapper = Tomcat.addServlet(ctx, "servlet", servlet);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
TesterAccessLogValve alv = new TesterAccessLogValve();
ctx.getPipeline().addValve(alv);
@@ -496,18 +496,18 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
Wrapper wrapper = Tomcat.addServlet(ctx, "time", timeout);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/start", "time");
+ ctx.addServletMapping("/start", "time");
if (asyncDispatch != null) {
if (asyncDispatch.booleanValue()) {
AsyncStartRunnable asyncStartRunnable = new AsyncStartRunnable();
Wrapper async = Tomcat.addServlet(ctx, "async", asyncStartRunnable);
async.setAsyncSupported(true);
- ctx.addServletMappingDecoded(dispatchUrl, "async");
+ ctx.addServletMapping(dispatchUrl, "async");
} else {
NonAsyncServlet nonAsync = new NonAsyncServlet();
Tomcat.addServlet(ctx, "nonasync", nonAsync);
- ctx.addServletMappingDecoded(dispatchUrl, "nonasync");
+ ctx.addServletMapping(dispatchUrl, "nonasync");
}
}
@@ -654,12 +654,12 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
DispatchingServlet dispatch = new DispatchingServlet(false, false);
Wrapper wrapper = Tomcat.addServlet(ctx, "dispatch", dispatch);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/stage1", "dispatch");
+ ctx.addServletMapping("/stage1", "dispatch");
NonAsyncServlet nonasync = new NonAsyncServlet();
Wrapper wrapper2 = Tomcat.addServlet(ctx, "nonasync", nonasync);
wrapper2.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/stage2", "nonasync");
+ ctx.addServletMapping("/stage2", "nonasync");
ctx.addApplicationListener(TrackingRequestListener.class.getName());
@@ -777,12 +777,12 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
TrackingServlet tracking = new TrackingServlet();
Wrapper wrapper = Tomcat.addServlet(ctx, "tracking", tracking);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/stage1", "tracking");
+ ctx.addServletMapping("/stage1", "tracking");
TimeoutServlet timeout = new TimeoutServlet(Boolean.TRUE, null);
Wrapper wrapper2 = Tomcat.addServlet(ctx, "timeout", timeout);
wrapper2.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/stage2", "timeout");
+ ctx.addServletMapping("/stage2", "timeout");
TesterAccessLogValve alv = new TesterAccessLogValve();
ctx.getPipeline().addValve(alv);
@@ -1009,11 +1009,11 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
DispatchingServlet dispatch = new DispatchingServlet(true, completeOnError);
Wrapper wrapper = Tomcat.addServlet(ctx, "dispatch", dispatch);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/stage1", "dispatch");
+ ctx.addServletMapping("/stage1", "dispatch");
ErrorServlet error = new ErrorServlet();
Tomcat.addServlet(ctx, "error", error);
- ctx.addServletMappingDecoded("/stage2", "error");
+ ctx.addServletMapping("/stage2", "error");
ctx.addApplicationListener(TrackingRequestListener.class.getName());
@@ -1087,7 +1087,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
AsyncStartRunnable servlet = new AsyncStartRunnable();
Wrapper wrapper = Tomcat.addServlet(ctx, "servlet", servlet);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
TesterAccessLogValve alv = new TesterAccessLogValve();
ctx.getPipeline().addValve(alv);
@@ -1153,7 +1153,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
Wrapper wrapper = Tomcat.addServlet(ctx, "servlet", servlet);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
TesterAccessLogValve alv = new TesterAccessLogValve();
ctx.getPipeline().addValve(alv);
@@ -1213,7 +1213,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
ErrorServlet error = new ErrorServlet();
Tomcat.addServlet(ctx, "error", error);
- ctx.addServletMappingDecoded("/error", "error");
+ ctx.addServletMapping("/error", "error");
TesterAccessLogValve alv = new TesterAccessLogValve();
ctx.getPipeline().addValve(alv);
@@ -1248,7 +1248,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
AsyncStatusServlet asyncStatusServlet = new AsyncStatusServlet(HttpServletResponse.SC_BAD_REQUEST);
Wrapper wrapper = Tomcat.addServlet(ctx, "asyncStatusServlet", asyncStatusServlet);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/asyncStatusServlet", "asyncStatusServlet");
+ ctx.addServletMapping("/asyncStatusServlet", "asyncStatusServlet");
TesterAccessLogValve alv = new TesterAccessLogValve();
ctx.getPipeline().addValve(alv);
@@ -1322,12 +1322,12 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
AsyncErrorServlet asyncErrorServlet = new AsyncErrorServlet(HttpServletResponse.SC_BAD_REQUEST, threaded);
Wrapper wrapper = Tomcat.addServlet(ctx, "asyncErrorServlet", asyncErrorServlet);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/asyncErrorServlet", "asyncErrorServlet");
+ ctx.addServletMapping("/asyncErrorServlet", "asyncErrorServlet");
if (customError) {
CustomErrorServlet customErrorServlet = new CustomErrorServlet();
Tomcat.addServlet(ctx, "customErrorServlet", customErrorServlet);
- ctx.addServletMappingDecoded("/customErrorServlet", "customErrorServlet");
+ ctx.addServletMapping("/customErrorServlet", "customErrorServlet");
ErrorPage ep = new ErrorPage();
ep.setLocation("/customErrorServlet");
@@ -1437,9 +1437,9 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
Wrapper b = Tomcat.addServlet(ctx, "ServletB", new Bug53337ServletB());
b.setAsyncSupported(true);
Tomcat.addServlet(ctx, "ServletC", new Bug53337ServletC());
- ctx.addServletMappingDecoded("/ServletA", "ServletA");
- ctx.addServletMappingDecoded("/ServletB", "ServletB");
- ctx.addServletMappingDecoded("/ServletC", "ServletC");
+ ctx.addServletMapping("/ServletA", "ServletA");
+ ctx.addServletMapping("/ServletB", "ServletB");
+ ctx.addServletMapping("/ServletC", "ServletC");
tomcat.start();
@@ -1514,8 +1514,8 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
a.setAsyncSupported(true);
Tomcat.addServlet(ctx, "ServletB", new Bug53843ServletB());
- ctx.addServletMappingDecoded("/ServletA", "ServletA");
- ctx.addServletMappingDecoded("/ServletB", "ServletB");
+ ctx.addServletMapping("/ServletA", "ServletA");
+ ctx.addServletMapping("/ServletB", "ServletB");
tomcat.start();
@@ -1621,17 +1621,17 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
TimeoutServlet timeout = new TimeoutServlet(null, null);
Wrapper w1 = Tomcat.addServlet(ctx, "time", timeout);
w1.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/async", "time");
+ ctx.addServletMapping("/async", "time");
NonAsyncServlet nonAsync = new NonAsyncServlet();
Wrapper w2 = Tomcat.addServlet(ctx, "nonAsync", nonAsync);
w2.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/error/nonasync", "nonAsync");
+ ctx.addServletMapping("/error/nonasync", "nonAsync");
AsyncErrorPage asyncErrorPage = new AsyncErrorPage(mode);
Wrapper w3 = Tomcat.addServlet(ctx, "asyncErrorPage", asyncErrorPage);
w3.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/error/async", "asyncErrorPage");
+ ctx.addServletMapping("/error/async", "asyncErrorPage");
if (asyncError != null) {
ErrorPage ep = new ErrorPage();
@@ -1747,11 +1747,11 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
Bug54178ServletA bug54178ServletA = new Bug54178ServletA();
Wrapper wrapper = Tomcat.addServlet(ctx, "bug54178ServletA", bug54178ServletA);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/bug54178ServletA", "bug54178ServletA");
+ ctx.addServletMapping("/bug54178ServletA", "bug54178ServletA");
Bug54178ServletB bug54178ServletB = new Bug54178ServletB();
Tomcat.addServlet(ctx, "bug54178ServletB", bug54178ServletB);
- ctx.addServletMappingDecoded("/bug54178ServletB", "bug54178ServletB");
+ ctx.addServletMapping("/bug54178ServletB", "bug54178ServletB");
tomcat.start();
@@ -1854,7 +1854,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
Bug59219Servlet bug59219Servlet = new Bug59219Servlet();
Wrapper w = tomcat.addServlet("", "async", bug59219Servlet);
w.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/async", "async");
+ ctx.addServletMapping("/async", "async");
tomcat.start();
@@ -1917,12 +1917,12 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
NonAsyncServlet nonAsyncServlet = new NonAsyncServlet();
Wrapper wrapper = Tomcat.addServlet(ctx, "nonAsyncServlet", nonAsyncServlet);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/target", "nonAsyncServlet");
+ ctx.addServletMapping("/target", "nonAsyncServlet");
DispatchingGenericServlet forbiddenDispatchingServlet = new DispatchingGenericServlet();
Wrapper wrapper1 = Tomcat.addServlet(ctx, "forbiddenDispatchingServlet", forbiddenDispatchingServlet);
wrapper1.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/forbiddenDispatchingServlet", "forbiddenDispatchingServlet");
+ ctx.addServletMapping("/forbiddenDispatchingServlet", "forbiddenDispatchingServlet");
tomcat.start();
@@ -2001,7 +2001,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
Wrapper w = Tomcat.addServlet(ctx, "AsyncISEServlet", servlet);
w.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/test", "AsyncISEServlet");
+ ctx.addServletMapping("/test", "AsyncISEServlet");
tomcat.start();
@@ -2118,12 +2118,12 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
DispatchingGenericServlet dispatch = new DispatchingGenericServlet();
Wrapper wrapper = Tomcat.addServlet(ctx, "dispatch", dispatch);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/dispatch", "dispatch");
+ ctx.addServletMapping("/dispatch", "dispatch");
CustomGenericServlet customGeneric = new CustomGenericServlet();
Wrapper wrapper2 = Tomcat.addServlet(ctx, "customGeneric", customGeneric);
wrapper2.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/target", "customGeneric");
+ ctx.addServletMapping("/target", "customGeneric");
tomcat.start();
}
@@ -2158,16 +2158,16 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
Servlet stage1 = new DispatchingServletTracking("/stage2", true);
Wrapper wrapper1 = Tomcat.addServlet(ctx, "stage1", stage1);
wrapper1.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/stage1", "stage1");
+ ctx.addServletMapping("/stage1", "stage1");
Servlet stage2 = new DispatchingServletTracking("/stage3", false);
Wrapper wrapper2 = Tomcat.addServlet(ctx, "stage2", stage2);
wrapper2.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/stage2", "stage2");
+ ctx.addServletMapping("/stage2", "stage2");
Servlet stage3 = new NonAsyncServlet();
Tomcat.addServlet(ctx, "stage3", stage3);
- ctx.addServletMappingDecoded("/stage3", "stage3");
+ ctx.addServletMapping("/stage3", "stage3");
TesterAccessLogValve alv = new TesterAccessLogValve();
ctx.getPipeline().addValve(alv);
@@ -2231,7 +2231,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
Servlet servlet = new AsyncRequestUriServlet();
Wrapper wrapper1 = Tomcat.addServlet(ctx, "bug57559", servlet);
wrapper1.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/", "bug57559");
+ ctx.addServletMapping("/", "bug57559");
tomcat.start();
@@ -2268,17 +2268,17 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
NonAsyncServlet nonAsyncServlet = new NonAsyncServlet();
Tomcat.addServlet(ctx, "nonAsyncServlet", nonAsyncServlet);
- ctx.addServletMappingDecoded("/target", "nonAsyncServlet");
+ ctx.addServletMapping("/target", "nonAsyncServlet");
AsyncStashServlet asyncStashServlet = new AsyncStashServlet();
Wrapper w1 = Tomcat.addServlet(ctx, "asyncStashServlet", asyncStashServlet);
w1.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/asyncStashServlet", "asyncStashServlet");
+ ctx.addServletMapping("/asyncStashServlet", "asyncStashServlet");
AsyncRetrieveServlet asyncRetrieveServlet = new AsyncRetrieveServlet();
Wrapper w2 = Tomcat.addServlet(ctx, "asyncRetrieveServlet", asyncRetrieveServlet);
w2.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/asyncRetrieveServlet", "asyncRetrieveServlet");
+ ctx.addServletMapping("/asyncRetrieveServlet", "asyncRetrieveServlet");
tomcat.start();
@@ -2367,8 +2367,8 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
tomcat.addServlet("", "timeout", Bug58751AsyncServlet.class.getName()).setAsyncSupported(true);
CustomErrorServlet customErrorServlet = new CustomErrorServlet();
Tomcat.addServlet(context, "customErrorServlet", customErrorServlet);
- context.addServletMappingDecoded("/timeout", "timeout");
- context.addServletMappingDecoded("/error", "customErrorServlet");
+ context.addServletMapping("/timeout", "timeout");
+ context.addServletMapping("/error", "customErrorServlet");
ErrorPage errorPage = new ErrorPage();
errorPage.setLocation("/error");
context.addErrorPage(errorPage);
@@ -2492,7 +2492,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
} else {
Tomcat.addServlet(context, "space", new ForwardDispatchUrlWithSpacesServlet());
}
- context.addServletMappingDecoded("/space/*", "space");
+ context.addServletMapping("/space/*", "space");
tomcat.start();
ByteChunk responseBody = new ByteChunk();
@@ -2587,7 +2587,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
EncodedDispatchServlet encodedDispatchServlet = new EncodedDispatchServlet();
Wrapper wrapper = Tomcat.addServlet(ctx, "encodedDispatchServlet", encodedDispatchServlet);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/*", "encodedDispatchServlet");
+ ctx.addServletMapping("/*", "encodedDispatchServlet");
tomcat.start();
@@ -2657,11 +2657,11 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
AsyncIoEndServlet asyncIoEndServlet = new AsyncIoEndServlet(useThread, useComplete);
Wrapper wrapper = Tomcat.addServlet(ctx, "asyncIoEndServlet", asyncIoEndServlet);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/asyncIoEndServlet", "asyncIoEndServlet");
+ ctx.addServletMapping("/asyncIoEndServlet", "asyncIoEndServlet");
SimpleServlet simpleServlet = new SimpleServlet();
Tomcat.addServlet(ctx, "simpleServlet", simpleServlet);
- ctx.addServletMappingDecoded("/simpleServlet", "simpleServlet");
+ ctx.addServletMapping("/simpleServlet", "simpleServlet");
tomcat.start();
@@ -2811,7 +2811,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
Bug63816Servlet bug63816Servlet = new Bug63816Servlet(doGetLatch, clientCloseLatch, threadCompleteLatch, ise);
Wrapper wrapper = Tomcat.addServlet(ctx, "bug63816Servlet", bug63816Servlet);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/*", "bug63816Servlet");
+ ctx.addServletMapping("/*", "bug63816Servlet");
tomcat.start();
@@ -2979,7 +2979,7 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
PostServlet postServlet = new PostServlet(partialReadLatch, clientCloseLatch, threadCompleteLatch, testFailed);
Wrapper wrapper = Tomcat.addServlet(ctx, "postServlet", postServlet);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/*", "postServlet");
+ ctx.addServletMapping("/*", "postServlet");
tomcat.start();
diff --git a/test/org/apache/catalina/core/TestAsyncContextImplDispatch.java b/test/org/apache/catalina/core/TestAsyncContextImplDispatch.java
index b6cd0f2697..83534e393a 100644
--- a/test/org/apache/catalina/core/TestAsyncContextImplDispatch.java
+++ b/test/org/apache/catalina/core/TestAsyncContextImplDispatch.java
@@ -86,11 +86,11 @@ public class TestAsyncContextImplDispatch extends TomcatBaseTest {
Wrapper w1 = Tomcat.addServlet(ctx, "target", new TesterServlet());
w1.setAsyncSupported(targetAsyncSupported);
- ctx.addServletMappingDecoded("/target", "target");
+ ctx.addServletMapping("/target", "target");
Wrapper w2 = Tomcat.addServlet(ctx, "dispatch", new TesterDispatchServlet(dispatchAsyncStart));
w2.setAsyncSupported(dispatchAsyncSupported);
- ctx.addServletMappingDecoded("/dispatch", "dispatch");
+ ctx.addServletMapping("/dispatch", "dispatch");
tomcat.start();
diff --git a/test/org/apache/catalina/core/TestAsyncContextImplListenerOnComplete.java b/test/org/apache/catalina/core/TestAsyncContextImplListenerOnComplete.java
index 0f4f06a0ea..519fe71878 100644
--- a/test/org/apache/catalina/core/TestAsyncContextImplListenerOnComplete.java
+++ b/test/org/apache/catalina/core/TestAsyncContextImplListenerOnComplete.java
@@ -80,7 +80,7 @@ public class TestAsyncContextImplListenerOnComplete extends TomcatBaseTest {
servletWrapper.setAsyncSupported(true);
servletWrapper.setLoadOnStartup(1);
- ctx.addServletMappingDecoded("/", "repro-servlet");
+ ctx.addServletMapping("/", "repro-servlet");
tomcat.start();
Thread.sleep(2000);
diff --git a/test/org/apache/catalina/core/TestAsyncContextIoError.java b/test/org/apache/catalina/core/TestAsyncContextIoError.java
index 3371967b99..bab47e4acd 100644
--- a/test/org/apache/catalina/core/TestAsyncContextIoError.java
+++ b/test/org/apache/catalina/core/TestAsyncContextIoError.java
@@ -56,11 +56,11 @@ public class TestAsyncContextIoError extends TomcatBaseTest {
AsyncServlet asyncServlet = new AsyncServlet();
Wrapper asyncWrapper = Tomcat.addServlet(ctx, "async", asyncServlet);
asyncWrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/async", "async");
+ ctx.addServletMapping("/async", "async");
ErrorServlet errorServlet = new ErrorServlet();
Tomcat.addServlet(ctx, "error", errorServlet);
- ctx.addServletMappingDecoded("/error", "error");
+ ctx.addServletMapping("/error", "error");
tomcat.start();
diff --git a/test/org/apache/catalina/core/TestAsyncContextStateChanges.java b/test/org/apache/catalina/core/TestAsyncContextStateChanges.java
index 841d101c3d..542db55330 100644
--- a/test/org/apache/catalina/core/TestAsyncContextStateChanges.java
+++ b/test/org/apache/catalina/core/TestAsyncContextStateChanges.java
@@ -105,7 +105,7 @@ public class TestAsyncContextStateChanges extends TomcatBaseTest {
AsyncServlet bug63816Servlet = new AsyncServlet();
Wrapper wrapper = Tomcat.addServlet(ctx, "bug63816Servlet", bug63816Servlet);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/*", "bug63816Servlet");
+ ctx.addServletMapping("/*", "bug63816Servlet");
tomcat.start();
diff --git a/test/org/apache/catalina/core/TestPropertiesRoleMappingListener.java b/test/org/apache/catalina/core/TestPropertiesRoleMappingListener.java
index d8c656b7e5..cc664c29e0 100644
--- a/test/org/apache/catalina/core/TestPropertiesRoleMappingListener.java
+++ b/test/org/apache/catalina/core/TestPropertiesRoleMappingListener.java
@@ -119,7 +119,7 @@ public class TestPropertiesRoleMappingListener extends TomcatBaseTest {
ctx.addLifecycleListener(listener);
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
LoginConfig loginConfig = new LoginConfig();
loginConfig.setAuthMethod(HttpServletRequest.BASIC_AUTH);
diff --git a/test/org/apache/catalina/core/TestStandardContext.java b/test/org/apache/catalina/core/TestStandardContext.java
index 9e0b5a20dd..4f8f469695 100644
--- a/test/org/apache/catalina/core/TestStandardContext.java
+++ b/test/org/apache/catalina/core/TestStandardContext.java
@@ -145,13 +145,13 @@ public class TestStandardContext extends TomcatBaseTest {
context.addFilterDef(filterDef);
FilterMap filterMap = new FilterMap();
filterMap.setFilterName("Bug46243");
- filterMap.addURLPatternDecoded("*");
+ filterMap.addURLPattern("*");
context.addFilterMap(filterMap);
// Add a test servlet so there is something to generate a response if
// it works (although it shouldn't)
Tomcat.addServlet(context, "Bug46243", new HelloWorldServlet());
- context.addServletMappingDecoded("/", "Bug46243");
+ context.addServletMapping("/", "Bug46243");
}
private static final class Bug46243Client extends SimpleHttpClient {
@@ -715,8 +715,8 @@ public class TestStandardContext extends TomcatBaseTest {
// to set our own MultipartConfigElement.
w.setMultipartConfigElement(new MultipartConfigElement(""));
- context.addServletMappingDecoded("/regular", "regular");
- context.addServletMappingDecoded("/multipart", "multipart");
+ context.addServletMapping("/regular", "regular");
+ context.addServletMapping("/multipart", "multipart");
tomcat.start();
setPort(tomcat.getConnector().getLocalPort());
diff --git a/test/org/apache/catalina/core/TestStandardContextAliases.java b/test/org/apache/catalina/core/TestStandardContextAliases.java
index e652612e58..c1823a5be9 100644
--- a/test/org/apache/catalina/core/TestStandardContextAliases.java
+++ b/test/org/apache/catalina/core/TestStandardContextAliases.java
@@ -53,7 +53,7 @@ public class TestStandardContextAliases extends TomcatBaseTest {
Tomcat.addServlet(ctx, "test", new TestServlet());
- ctx.addServletMappingDecoded("/", "test");
+ ctx.addServletMapping("/", "test");
tomcat.start();
diff --git a/test/org/apache/catalina/core/TestStandardContextResources.java b/test/org/apache/catalina/core/TestStandardContextResources.java
index f26f7a711a..52e216eb37 100644
--- a/test/org/apache/catalina/core/TestStandardContextResources.java
+++ b/test/org/apache/catalina/core/TestStandardContextResources.java
@@ -119,7 +119,7 @@ public class TestStandardContextResources extends TomcatBaseTest {
(StandardContext) tomcat.addWebapp(null, "/test", appDir.getAbsolutePath(), absoluteOrderConfig);
Tomcat.addServlet(ctx, "getresource", new GetResourceServlet());
- ctx.addServletMappingDecoded("/getresource", "getresource");
+ ctx.addServletMapping("/getresource", "getresource");
tomcat.start();
assertPageContains("/test/getresource?path=/resourceF.jsp", "<p>resourceF.jsp in resources2.jar</p>");
@@ -137,7 +137,7 @@ public class TestStandardContextResources extends TomcatBaseTest {
ctx = (StandardContext) tomcat.addWebapp(null, "/test", appDir.getAbsolutePath(), absoluteOrderConfig);
Tomcat.addServlet(ctx, "getresource", new GetResourceServlet());
- ctx.addServletMappingDecoded("/getresource", "getresource");
+ ctx.addServletMapping("/getresource", "getresource");
tomcat.getHost().start();
@@ -189,7 +189,7 @@ public class TestStandardContextResources extends TomcatBaseTest {
skipTldsForResourceJars(ctx);
Tomcat.addServlet(ctx, "getresource", new GetResourceServlet());
- ctx.addServletMappingDecoded("/getresource", "getresource");
+ ctx.addServletMapping("/getresource", "getresource");
tomcat.start();
diff --git a/test/org/apache/catalina/core/TestStandardContextValve.java b/test/org/apache/catalina/core/TestStandardContextValve.java
index 67013cd278..1974c82c74 100644
--- a/test/org/apache/catalina/core/TestStandardContextValve.java
+++ b/test/org/apache/catalina/core/TestStandardContextValve.java
@@ -54,7 +54,7 @@ public class TestStandardContextValve extends TomcatBaseTest {
// Add the error page
Tomcat.addServlet(ctx, "errorPage", new Bug51653ErrorPage(trace));
- ctx.addServletMappingDecoded("/error", "errorPage");
+ ctx.addServletMapping("/error", "errorPage");
// And the handling for 404 responses
ErrorPage errorPage = new ErrorPage();
errorPage.setErrorCode(Response.SC_NOT_FOUND);
@@ -99,11 +99,11 @@ public class TestStandardContextValve extends TomcatBaseTest {
// Add the page that generates the error
Tomcat.addServlet(ctx, "test", new Bug51653ErrorTrigger());
- ctx.addServletMappingDecoded("/test", "test");
+ ctx.addServletMapping("/test", "test");
// Add the error page
Tomcat.addServlet(ctx, "errorPage", new Bug51653ErrorPage(trace));
- ctx.addServletMappingDecoded("/error", "errorPage");
+ ctx.addServletMapping("/error", "errorPage");
// And the handling for 404 responses
ErrorPage errorPage = new ErrorPage();
errorPage.setErrorCode(Response.SC_NOT_FOUND);
@@ -230,7 +230,7 @@ public class TestStandardContextValve extends TomcatBaseTest {
final Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "echo", new EchoBodyServlet());
- ctx.addServletMappingDecoded("/echo", "echo");
+ ctx.addServletMapping("/echo", "echo");
tomcat.start();
diff --git a/test/org/apache/catalina/core/TestStandardHostValve.java b/test/org/apache/catalina/core/TestStandardHostValve.java
index 59a08978ea..5058e93567 100644
--- a/test/org/apache/catalina/core/TestStandardHostValve.java
+++ b/test/org/apache/catalina/core/TestStandardHostValve.java
@@ -84,11 +84,11 @@ public class TestStandardHostValve extends TomcatBaseTest {
// Add the error page
Tomcat.addServlet(ctx, "error", new ErrorServlet());
- ctx.addServletMappingDecoded("/error", "error");
+ ctx.addServletMapping("/error", "error");
// Add the error handling page
Tomcat.addServlet(ctx, "report", new ReportServlet());
- ctx.addServletMappingDecoded("/report/*", "report");
+ ctx.addServletMapping("/report/*", "report");
// Add the handling for 400 responses
ErrorPage errorPage400 = new ErrorPage();
@@ -158,7 +158,7 @@ public class TestStandardHostValve extends TomcatBaseTest {
// Add the error page
Tomcat.addServlet(ctx, "error", new ErrorServlet());
- ctx.addServletMappingDecoded("/error", "error");
+ ctx.addServletMapping("/error", "error");
final List<String> result = new ArrayList<>();
@@ -200,11 +200,11 @@ public class TestStandardHostValve extends TomcatBaseTest {
// Add the error page
Tomcat.addServlet(ctx, "error", new ExceptionServlet());
- ctx.addServletMappingDecoded("/error", "error");
+ ctx.addServletMapping("/error", "error");
// Add the error handling page
Tomcat.addServlet(ctx, "report", new ReportServlet());
- ctx.addServletMappingDecoded("/report/*", "report");
+ ctx.addServletMapping("/report/*", "report");
// Add the handling for 500 responses
ErrorPage errorPage500 = new ErrorPage();
diff --git a/test/org/apache/catalina/core/TestStandardWrapper.java b/test/org/apache/catalina/core/TestStandardWrapper.java
index a154f5a104..2c6cab3695 100644
--- a/test/org/apache/catalina/core/TestStandardWrapper.java
+++ b/test/org/apache/catalina/core/TestStandardWrapper.java
@@ -255,7 +255,7 @@ public class TestStandardWrapper extends TomcatBaseTest {
Wrapper wrapper = Tomcat.addServlet(ctx, "servlet", RoleAllowServlet.class.getName());
wrapper.addSecurityReference("testSecurityRoleRef", "very-complex-role-name");
wrapper.addSecurityReference("testSecurityRoleRef2", "testRole");
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
ctx.setLoginConfig(new LoginConfig("BASIC", null, null, null));
ctx.getPipeline().addValve(new BasicAuthenticator());
@@ -352,7 +352,7 @@ public class TestStandardWrapper extends TomcatBaseTest {
Wrapper wrapper = Tomcat.addServlet(ctx, "servlet", servletClassName);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
if (useRole) {
TesterMapRealm realm = new TesterMapRealm();
diff --git a/test/org/apache/catalina/core/TestSwallowAbortedUploads.java b/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
index 7670b438cc..6e8f0edeb9 100644
--- a/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
+++ b/test/org/apache/catalina/core/TestSwallowAbortedUploads.java
@@ -234,7 +234,7 @@ public class TestSwallowAbortedUploads extends TomcatBaseTest {
} else {
w.setMultipartConfigElement(new MultipartConfigElement(""));
}
- context.addServletMappingDecoded(URI, servletName);
+ context.addServletMapping(URI, servletName);
context.setSwallowAbortedUploads(swallow);
Connector c = tomcat.getConnector();
@@ -345,7 +345,7 @@ public class TestSwallowAbortedUploads extends TomcatBaseTest {
context = tomcat.addContext("", TEMP_DIR);
AbortedPOSTServlet servlet = new AbortedPOSTServlet(status);
Tomcat.addServlet(context, servletName, servlet);
- context.addServletMappingDecoded(URI, servletName);
+ context.addServletMapping(URI, servletName);
context.setSwallowAbortedUploads(swallow);
tomcat.start();
diff --git a/test/org/apache/catalina/filters/TestAddCharSetFilter.java b/test/org/apache/catalina/filters/TestAddCharSetFilter.java
index 62d5d8d2d4..5d2afe2e6d 100644
--- a/test/org/apache/catalina/filters/TestAddCharSetFilter.java
+++ b/test/org/apache/catalina/filters/TestAddCharSetFilter.java
@@ -98,7 +98,7 @@ public class TestAddCharSetFilter extends TomcatBaseTest {
// Add the Servlet
CharsetServlet servlet = new CharsetServlet(mode, useSetContentType);
Tomcat.addServlet(ctx, "servlet", servlet);
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
// Add the Filter
FilterDef filterDef = new FilterDef();
diff --git a/test/org/apache/catalina/filters/TestExpiresFilter.java b/test/org/apache/catalina/filters/TestExpiresFilter.java
index 1d5fa60811..fddd25296c 100644
--- a/test/org/apache/catalina/filters/TestExpiresFilter.java
+++ b/test/org/apache/catalina/filters/TestExpiresFilter.java
@@ -75,7 +75,7 @@ public class TestExpiresFilter extends TomcatBaseTest {
FilterMap filterMap = new FilterMap();
filterMap.setFilterName(ExpiresFilter.class.getName());
- filterMap.addURLPatternDecoded("*");
+ filterMap.addURLPattern("*");
tomcat.start();
try {
@@ -388,11 +388,11 @@ public class TestExpiresFilter extends TomcatBaseTest {
FilterMap filterMap = new FilterMap();
filterMap.setFilterName(ExpiresFilter.class.getName());
- filterMap.addURLPatternDecoded("*");
+ filterMap.addURLPattern("*");
root.addFilterMap(filterMap);
Tomcat.addServlet(root, servlet.getClass().getName(), servlet);
- root.addServletMappingDecoded("/test", servlet.getClass().getName());
+ root.addServletMapping("/test", servlet.getClass().getName());
tomcat.start();
@@ -507,7 +507,7 @@ public class TestExpiresFilter extends TomcatBaseTest {
FilterMap filterMap = new FilterMap();
filterMap.setFilterName(ExpiresFilter.class.getName());
- filterMap.addURLPatternDecoded("*");
+ filterMap.addURLPattern("*");
ctxt.addFilterMap(filterMap);
tomcat.start();
diff --git a/test/org/apache/catalina/filters/TestRateLimitFilter.java b/test/org/apache/catalina/filters/TestRateLimitFilter.java
index cb41ef968d..0470daa132 100644
--- a/test/org/apache/catalina/filters/TestRateLimitFilter.java
+++ b/test/org/apache/catalina/filters/TestRateLimitFilter.java
@@ -136,7 +136,7 @@ public class TestRateLimitFilter extends TomcatBaseTest {
FilterMap filterMap = new FilterMap();
filterMap.setFilterName(RateLimitFilter.class.getName());
- filterMap.addURLPatternDecoded("*");
+ filterMap.addURLPattern("*");
root.addFilterMap(filterMap);
return rateLimitFilter;
diff --git a/test/org/apache/catalina/filters/TestRateLimitFilterWithExactRateLimiter.java b/test/org/apache/catalina/filters/TestRateLimitFilterWithExactRateLimiter.java
index f48a0d447a..43fe0cd773 100644
--- a/test/org/apache/catalina/filters/TestRateLimitFilterWithExactRateLimiter.java
+++ b/test/org/apache/catalina/filters/TestRateLimitFilterWithExactRateLimiter.java
@@ -141,7 +141,7 @@ public class TestRateLimitFilterWithExactRateLimiter extends TomcatBaseTest {
FilterMap filterMap = new FilterMap();
filterMap.setFilterName(RateLimitFilter.class.getName());
- filterMap.addURLPatternDecoded("*");
+ filterMap.addURLPattern("*");
root.addFilterMap(filterMap);
return rateLimitFilter;
diff --git a/test/org/apache/catalina/filters/TestRemoteCIDRFilter.java b/test/org/apache/catalina/filters/TestRemoteCIDRFilter.java
index e170095cbb..5be1f4e671 100644
--- a/test/org/apache/catalina/filters/TestRemoteCIDRFilter.java
+++ b/test/org/apache/catalina/filters/TestRemoteCIDRFilter.java
@@ -228,7 +228,7 @@ public class TestRemoteCIDRFilter extends TomcatBaseTest {
FilterMap filterMap = new FilterMap();
filterMap.setFilterName(testFilterClass.getName());
- filterMap.addURLPatternDecoded(urlPattern);
+ filterMap.addURLPattern(urlPattern);
root.addFilterMap(filterMap);
FilterConfig filterConfig = TesterFilterConfigs.generateFilterConfig(filterDef);
diff --git a/test/org/apache/catalina/filters/TestRemoteIpFilter.java b/test/org/apache/catalina/filters/TestRemoteIpFilter.java
index 2c7eddf18c..d3182f2487 100644
--- a/test/org/apache/catalina/filters/TestRemoteIpFilter.java
+++ b/test/org/apache/catalina/filters/TestRemoteIpFilter.java
@@ -670,7 +670,7 @@ public class TestRemoteIpFilter extends TomcatBaseTest {
FilterMap filterMap = new FilterMap();
filterMap.setFilterName(RemoteIpFilter.class.getName());
- filterMap.addURLPatternDecoded("*");
+ filterMap.addURLPattern("*");
root.addFilterMap(filterMap);
getTomcatInstance().start();
@@ -755,13 +755,13 @@ public class TestRemoteIpFilter extends TomcatBaseTest {
FilterMap filterMap = new FilterMap();
filterMap.setFilterName(RemoteIpFilter.class.getName());
- filterMap.addURLPatternDecoded("*");
+ filterMap.addURLPattern("*");
root.addFilterMap(filterMap);
MockHttpServlet mockServlet = new MockHttpServlet();
Tomcat.addServlet(root, mockServlet.getClass().getName(), mockServlet);
- root.addServletMappingDecoded("/test", mockServlet.getClass().getName());
+ root.addServletMapping("/test", mockServlet.getClass().getName());
getTomcatInstance().start();
@@ -806,13 +806,13 @@ public class TestRemoteIpFilter extends TomcatBaseTest {
FilterMap filterMap = new FilterMap();
filterMap.setFilterName(RemoteIpFilter.class.getName());
- filterMap.addURLPatternDecoded("*");
+ filterMap.addURLPattern("*");
root.addFilterMap(filterMap);
Bug66471Servlet bug66471Servlet = new Bug66471Servlet();
Tomcat.addServlet(root, bug66471Servlet.getClass().getName(), bug66471Servlet);
- root.addServletMappingDecoded("/test", bug66471Servlet.getClass().getName());
+ root.addServletMapping("/test", bug66471Servlet.getClass().getName());
getTomcatInstance().start();
diff --git a/test/org/apache/catalina/filters/TestRestCsrfPreventionFilter2.java b/test/org/apache/catalina/filters/TestRestCsrfPreventionFilter2.java
index fbc07340ab..082a7e6802 100644
--- a/test/org/apache/catalina/filters/TestRestCsrfPreventionFilter2.java
+++ b/test/org/apache/catalina/filters/TestRestCsrfPreventionFilter2.java
@@ -270,7 +270,7 @@ public class TestRestCsrfPreventionFilter2 extends TomcatBaseTest {
context.setSessionTimeout(SHORT_SESSION_TIMEOUT_MINS);
Tomcat.addServlet(context, SERVLET_NAME, new TesterServlet());
- context.addServletMappingDecoded(URI_PROTECTED, SERVLET_NAME);
+ context.addServletMapping(URI_PROTECTED, SERVLET_NAME);
FilterDef filterDef = new FilterDef();
filterDef.setFilterName(FILTER_NAME);
@@ -280,11 +280,11 @@ public class TestRestCsrfPreventionFilter2 extends TomcatBaseTest {
FilterMap filterMap = new FilterMap();
filterMap.setFilterName(FILTER_NAME);
- filterMap.addURLPatternDecoded(URI_CSRF_PROTECTED);
+ filterMap.addURLPattern(URI_CSRF_PROTECTED);
context.addFilterMap(filterMap);
SecurityCollection collection = new SecurityCollection();
- collection.addPatternDecoded(URI_PROTECTED);
+ collection.addPattern(URI_PROTECTED);
SecurityConstraint sc = new SecurityConstraint();
sc.addAuthRole(ROLE);
diff --git a/test/org/apache/catalina/ha/context/TestReplicatedContext.java b/test/org/apache/catalina/ha/context/TestReplicatedContext.java
index 76481dc3bf..bc1c16c382 100644
--- a/test/org/apache/catalina/ha/context/TestReplicatedContext.java
+++ b/test/org/apache/catalina/ha/context/TestReplicatedContext.java
@@ -49,7 +49,7 @@ public class TestReplicatedContext extends TomcatBaseTest {
Context context = tomcat.addWebapp(host, "", root.getAbsolutePath());
Tomcat.addServlet(context, "test", new AccessContextServlet());
- context.addServletMappingDecoded("/access", "test");
+ context.addServletMapping("/access", "test");
tomcat.start();
diff --git a/test/org/apache/catalina/loader/TestWebappClassLoaderExecutorMemoryLeak.java b/test/org/apache/catalina/loader/TestWebappClassLoaderExecutorMemoryLeak.java
index 242e096ea2..84fff567f8 100644
--- a/test/org/apache/catalina/loader/TestWebappClassLoaderExecutorMemoryLeak.java
+++ b/test/org/apache/catalina/loader/TestWebappClassLoaderExecutorMemoryLeak.java
@@ -49,7 +49,7 @@ public class TestWebappClassLoaderExecutorMemoryLeak extends TomcatBaseTest {
ExecutorServlet executorServlet = new ExecutorServlet();
Tomcat.addServlet(ctx, "taskServlet", executorServlet);
- ctx.addServletMappingDecoded("/", "taskServlet");
+ ctx.addServletMapping("/", "taskServlet");
tomcat.start();
diff --git a/test/org/apache/catalina/loader/TestWebappClassLoaderMemoryLeak.java b/test/org/apache/catalina/loader/TestWebappClassLoaderMemoryLeak.java
index f14131f948..a6c3c5155f 100644
--- a/test/org/apache/catalina/loader/TestWebappClassLoaderMemoryLeak.java
+++ b/test/org/apache/catalina/loader/TestWebappClassLoaderMemoryLeak.java
@@ -47,7 +47,7 @@ public class TestWebappClassLoaderMemoryLeak extends TomcatBaseTest {
}
Tomcat.addServlet(ctx, "taskServlet", new TaskServlet());
- ctx.addServletMappingDecoded("/", "taskServlet");
+ ctx.addServletMapping("/", "taskServlet");
tomcat.start();
diff --git a/test/org/apache/catalina/loader/TesterWebappClassLoaderThreadLocalMemoryLeak.java b/test/org/apache/catalina/loader/TesterWebappClassLoaderThreadLocalMemoryLeak.java
index 2c71bc2888..a14d941bc4 100644
--- a/test/org/apache/catalina/loader/TesterWebappClassLoaderThreadLocalMemoryLeak.java
+++ b/test/org/apache/catalina/loader/TesterWebappClassLoaderThreadLocalMemoryLeak.java
@@ -61,7 +61,7 @@ public class TesterWebappClassLoaderThreadLocalMemoryLeak extends TomcatBaseTest
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "leakServlet1", "org.apache.tomcat.unittest.TesterLeakingServlet1");
- ctx.addServletMappingDecoded("/leak1", "leakServlet1");
+ ctx.addServletMapping("/leak1", "leakServlet1");
tomcat.start();
@@ -110,7 +110,7 @@ public class TesterWebappClassLoaderThreadLocalMemoryLeak extends TomcatBaseTest
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "leakServlet2", "org.apache.tomcat.unittest.TesterLeakingServlet2");
- ctx.addServletMappingDecoded("/leak2", "leakServlet2");
+ ctx.addServletMapping("/leak2", "leakServlet2");
tomcat.start();
diff --git a/test/org/apache/catalina/manager/TestHostManagerWebapp.java b/test/org/apache/catalina/manager/TestHostManagerWebapp.java
index 6368f1e66a..62276c22f1 100644
--- a/test/org/apache/catalina/manager/TestHostManagerWebapp.java
+++ b/test/org/apache/catalina/manager/TestHostManagerWebapp.java
@@ -68,7 +68,7 @@ public class TestHostManagerWebapp extends TomcatBaseTest {
Context context = getProgrammaticRootContext();
Tomcat.addServlet(context, "hello", new HelloWorldServlet());
- context.addServletMappingDecoded("/", "hello");
+ context.addServletMapping("/", "hello");
tomcat.start();
diff --git a/test/org/apache/catalina/manager/TestManagerWebapp.java b/test/org/apache/catalina/manager/TestManagerWebapp.java
index 11899d4572..c2442ce838 100644
--- a/test/org/apache/catalina/manager/TestManagerWebapp.java
+++ b/test/org/apache/catalina/manager/TestManagerWebapp.java
@@ -633,7 +633,7 @@ public class TestManagerWebapp extends TomcatBaseTest {
Context ctx = tomcat.addContext("/testapp", null);
Tomcat.addServlet(ctx, "default", new org.apache.catalina.servlets.DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/catalina/manager/TestStatusTransformer.java b/test/org/apache/catalina/manager/TestStatusTransformer.java
index 5dee74f796..2d5f6c8528 100644
--- a/test/org/apache/catalina/manager/TestStatusTransformer.java
+++ b/test/org/apache/catalina/manager/TestStatusTransformer.java
@@ -67,13 +67,13 @@ public class TestStatusTransformer extends TomcatBaseTest {
ctxt.setPrivileged(true);
Wrapper defaultServlet = Tomcat.addServlet(ctxt, "default", "org.apache.catalina.servlets.DefaultServlet");
defaultServlet.addInitParameter("fileEncoding", "ISO-8859-1");
- ctxt.addServletMappingDecoded("/", "default");
+ ctxt.addServletMapping("/", "default");
Tomcat.addServlet(ctxt, "status", "org.apache.catalina.manager.StatusManagerServlet");
- ctxt.addServletMappingDecoded("/status/*", "status");
+ ctxt.addServletMapping("/status/*", "status");
ctxt.addMimeMapping("html", "text/html");
Context ctxt2 = tomcat.addContext("/test", null);
Tomcat.addServlet(ctxt2, "status", "org.apache.catalina.manager.StatusManagerServlet");
- ctxt.addServletMappingDecoded("/somepath/*", "status");
+ ctxt.addServletMapping("/somepath/*", "status");
tomcat.start();
SimpleHttpClient client = new SimpleHttpClient() {
diff --git a/test/org/apache/catalina/mapper/TestMapperWebapps.java b/test/org/apache/catalina/mapper/TestMapperWebapps.java
index e3c0cdf495..46914e2dbf 100644
--- a/test/org/apache/catalina/mapper/TestMapperWebapps.java
+++ b/test/org/apache/catalina/mapper/TestMapperWebapps.java
@@ -51,7 +51,7 @@ public class TestMapperWebapps extends TomcatBaseTest {
Context ctx = tomcat.addContext("", null);
Tomcat.addServlet(ctx, "Bug53356", new Bug53356Servlet());
- ctx.addServletMappingDecoded("", "Bug53356");
+ ctx.addServletMapping("", "Bug53356");
tomcat.start();
@@ -215,8 +215,8 @@ public class TestMapperWebapps extends TomcatBaseTest {
// Add a security constraint
SecurityConstraint constraint = new SecurityConstraint();
SecurityCollection collection = new SecurityCollection();
- collection.addPatternDecoded("/welcome-files/*");
- collection.addPatternDecoded("/welcome-files");
+ collection.addPattern("/welcome-files/*");
+ collection.addPattern("/welcome-files");
constraint.addCollection(collection);
constraint.addAuthRole("foo");
root.addConstraint(constraint);
diff --git a/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java b/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java
index 2363309738..16951038ed 100644
--- a/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java
+++ b/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java
@@ -135,7 +135,7 @@ public class TestNonBlockingAPI extends TomcatBaseTest {
NBReadServlet servlet = new NBReadServlet(ignoreIsReady, async, null);
String servletName = NBReadServlet.class.getName();
Tomcat.addServlet(ctx, servletName, servlet);
- ctx.addServletMappingDecoded("/", servletName);
+ ctx.addServletMapping("/", servletName);
tomcat.start();
@@ -627,7 +627,7 @@ public class TestNonBlockingAPI extends TomcatBaseTest {
NBReadServlet servlet = new NBReadServlet(false, true, expectedTrailerFieldValue);
String servletName = NBReadServlet.class.getName();
Tomcat.addServlet(ctx, servletName, servlet);
- ctx.addServletMappingDecoded("/", servletName);
+ ctx.addServletMapping("/", servletName);
tomcat.getConnector().setProperty("allowedTrailerHeaders", TRAILER_HEADER_NAME);
@@ -690,7 +690,7 @@ public class TestNonBlockingAPI extends TomcatBaseTest {
NBWriteServlet servlet = new NBWriteServlet(asyncContextIsComplete);
String servletName = NBWriteServlet.class.getName();
Tomcat.addServlet(ctx, servletName, servlet);
- ctx.addServletMappingDecoded("/", servletName);
+ ctx.addServletMapping("/", servletName);
// Note: Low values of socket.txBufSize can trigger very poor
// performance. Set it just low enough to ensure that the
// non-blocking write servlet will see isReady() == false
@@ -870,7 +870,7 @@ public class TestNonBlockingAPI extends TomcatBaseTest {
NBWriteServlet servlet = new NBWriteServlet(asyncContextIsComplete, true, listenerCompletesOnError);
String servletName = NBWriteServlet.class.getName();
Tomcat.addServlet(ctx, servletName, servlet);
- ctx.addServletMappingDecoded("/", servletName);
+ ctx.addServletMapping("/", servletName);
// Note: Low values of socket.txBufSize can trigger very poor
// performance. Set it just low enough to ensure that the
// non-blocking write servlet will see isReady() == false
@@ -956,7 +956,7 @@ public class TestNonBlockingAPI extends TomcatBaseTest {
NBReadWriteServlet servlet = new NBReadWriteServlet();
String servletName = NBReadWriteServlet.class.getName();
Tomcat.addServlet(ctx, servletName, servlet);
- ctx.addServletMappingDecoded("/", servletName);
+ ctx.addServletMapping("/", servletName);
tomcat.start();
@@ -1467,7 +1467,7 @@ public class TestNonBlockingAPI extends TomcatBaseTest {
DelayedNBWriteServlet servlet = new DelayedNBWriteServlet(latch1);
String servletName = DelayedNBWriteServlet.class.getName();
Tomcat.addServlet(ctx, servletName, servlet);
- ctx.addServletMappingDecoded("/", servletName);
+ ctx.addServletMapping("/", servletName);
tomcat.start();
@@ -1499,7 +1499,7 @@ public class TestNonBlockingAPI extends TomcatBaseTest {
DelayedNBReadWriteServlet servlet = new DelayedNBReadWriteServlet(latch1);
String servletName = DelayedNBReadWriteServlet.class.getName();
Tomcat.addServlet(ctx, servletName, servlet);
- ctx.addServletMappingDecoded("/", servletName);
+ ctx.addServletMapping("/", servletName);
tomcat.start();
@@ -1756,7 +1756,7 @@ public class TestNonBlockingAPI extends TomcatBaseTest {
NBReadWithDispatchServlet servlet = new NBReadWithDispatchServlet();
String servletName = NBReadWithDispatchServlet.class.getName();
Tomcat.addServlet(ctx, servletName, servlet);
- ctx.addServletMappingDecoded("/", servletName);
+ ctx.addServletMapping("/", servletName);
tomcat.start();
@@ -1880,7 +1880,7 @@ public class TestNonBlockingAPI extends TomcatBaseTest {
PostServlet postServlet = new PostServlet(partialReadLatch, completeLatch, testFailed);
Wrapper wrapper = Tomcat.addServlet(ctx, "postServlet", postServlet);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/*", "postServlet");
+ ctx.addServletMapping("/*", "postServlet");
tomcat.start();
@@ -2053,7 +2053,7 @@ public class TestNonBlockingAPI extends TomcatBaseTest {
new NBWriteServlet02(responseCommitLatch, clientCloseLatch, asyncCompleteLatch, swallowIoException);
Wrapper wrapper = Tomcat.addServlet(ctx, "writeServlet", writeServlet);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/*", "writeServlet");
+ ctx.addServletMapping("/*", "writeServlet");
tomcat.start();
diff --git a/test/org/apache/catalina/realm/TestRealmBase.java b/test/org/apache/catalina/realm/TestRealmBase.java
index 59d048173e..c71063b270 100644
--- a/test/org/apache/catalina/realm/TestRealmBase.java
+++ b/test/org/apache/catalina/realm/TestRealmBase.java
@@ -661,7 +661,7 @@ public class TestRealmBase {
deleteConstraint.addAuthRole(ROLE1);
SecurityCollection deleteCollection = new SecurityCollection();
deleteCollection.addMethod(Method.DELETE);
- deleteCollection.addPatternDecoded("/*");
+ deleteCollection.addPattern("/*");
deleteConstraint.addCollection(deleteCollection);
TesterMapRealm mapRealm = new TesterMapRealm();
@@ -800,12 +800,12 @@ public class TestRealmBase {
// Add a collection for GET
SecurityCollection getCollection = new SecurityCollection();
getCollection.addMethod(Method.GET);
- getCollection.addPatternDecoded("*.html");
+ getCollection.addPattern("*.html");
constraint.addCollection(getCollection);
// Add a collection for POST
SecurityCollection postCollection = new SecurityCollection();
postCollection.addMethod(Method.POST);
- postCollection.addPatternDecoded("*.html");
+ postCollection.addPattern("*.html");
constraint.addCollection(postCollection);
TesterMapRealm mapRealm = new TesterMapRealm();
@@ -880,13 +880,13 @@ public class TestRealmBase {
SecurityConstraint allowConstraint = new SecurityConstraint();
SecurityCollection allowCollection = new SecurityCollection();
allowCollection.addMethod(Method.GET);
- allowCollection.addPatternDecoded("/");
+ allowCollection.addPattern("/");
allowConstraint.addCollection(allowCollection);
// Create a constraint that disallows everything but GET
SecurityConstraint blockConstraint = new SecurityConstraint();
SecurityCollection blockCollection = new SecurityCollection();
blockCollection.addOmittedMethod(Method.GET);
- blockCollection.addPatternDecoded("/");
+ blockCollection.addPattern("/");
blockConstraint.addCollection(blockCollection);
blockConstraint.addAuthRole(ROLE1);
diff --git a/test/org/apache/catalina/servlets/DefaultServletEncodingBaseTest.java b/test/org/apache/catalina/servlets/DefaultServletEncodingBaseTest.java
index ad1e2f9729..9222a76c37 100644
--- a/test/org/apache/catalina/servlets/DefaultServletEncodingBaseTest.java
+++ b/test/org/apache/catalina/servlets/DefaultServletEncodingBaseTest.java
@@ -190,12 +190,12 @@ public abstract class DefaultServletEncodingBaseTest extends TomcatBaseTest {
defaultServlet.addInitParameter("fileEncoding", fileEncoding);
defaultServlet.addInitParameter("useBomIfPresent", getUseBom().configurationValue);
- ctxt.addServletMappingDecoded("/", "default");
+ ctxt.addServletMapping("/", "default");
if (useInclude) {
Tomcat.addServlet(ctxt, "include", new EncodingServlet(
outputEncoding, callSetCharacterEncoding, targetFile, useWriter));
- ctxt.addServletMappingDecoded("/include", "include");
+ ctxt.addServletMapping("/include", "include");
}
tomcat.start();
diff --git a/test/org/apache/catalina/servlets/ServletOptionsBaseTest.java b/test/org/apache/catalina/servlets/ServletOptionsBaseTest.java
index 2fdc365c0b..32a28217b9 100644
--- a/test/org/apache/catalina/servlets/ServletOptionsBaseTest.java
+++ b/test/org/apache/catalina/servlets/ServletOptionsBaseTest.java
@@ -85,7 +85,7 @@ public abstract class ServletOptionsBaseTest extends TomcatBaseTest {
w.addInitParameter("listings", Boolean.toString(listings));
w.addInitParameter("readonly", Boolean.toString(readonly));
- ctx.addServletMappingDecoded("/*", "servlet");
+ ctx.addServletMapping("/*", "servlet");
// Disable class path scanning - it slows the tests down by almost an order of magnitude
((StandardJarScanner) ctx.getJarScanner()).setScanClassPath(false);
diff --git a/test/org/apache/catalina/servlets/TestDefaultServlet.java b/test/org/apache/catalina/servlets/TestDefaultServlet.java
index 6a0615f366..8a6fd9a9c5 100644
--- a/test/org/apache/catalina/servlets/TestDefaultServlet.java
+++ b/test/org/apache/catalina/servlets/TestDefaultServlet.java
@@ -100,7 +100,7 @@ public class TestDefaultServlet extends TomcatBaseTest {
Wrapper defaultServlet = Tomcat.addServlet(ctxt, "default",
"org.apache.catalina.servlets.DefaultServlet");
defaultServlet.addInitParameter("fileEncoding", "ISO-8859-1");
- ctxt.addServletMappingDecoded("/", "default");
+ ctxt.addServletMapping("/", "default");
ctxt.addMimeMapping("html", "text/html");
@@ -146,7 +146,7 @@ public class TestDefaultServlet extends TomcatBaseTest {
"org.apache.catalina.servlets.DefaultServlet");
defaultServlet.addInitParameter("gzip", "true");
defaultServlet.addInitParameter("fileEncoding", "ISO-8859-1");
- ctxt.addServletMappingDecoded("/", "default");
+ ctxt.addServletMapping("/", "default");
ctxt.addMimeMapping("html", "text/html");
@@ -203,7 +203,7 @@ public class TestDefaultServlet extends TomcatBaseTest {
defaultServlet.addInitParameter("precompressed", "true");
defaultServlet.addInitParameter("fileEncoding", "ISO-8859-1");
- ctxt.addServletMappingDecoded("/", "default");
+ ctxt.addServletMapping("/", "default");
ctxt.addMimeMapping("html", "text/html");
tomcat.start();
@@ -266,7 +266,7 @@ public class TestDefaultServlet extends TomcatBaseTest {
DefaultServlet.class.getName());
defaultServlet.addInitParameter("precompressed", "gzip=.gz,custom=.br");
- ctxt.addServletMappingDecoded("/", "default");
+ ctxt.addServletMapping("/", "default");
ctxt.addMimeMapping("html", "text/html");
tomcat.start();
@@ -329,7 +329,7 @@ public class TestDefaultServlet extends TomcatBaseTest {
defaultServlet.addInitParameter("precompressed", "br=.br,gzip=.gz");
defaultServlet.addInitParameter("fileEncoding", "ISO-8859-1");
- ctxt.addServletMappingDecoded("/", "default");
+ ctxt.addServletMapping("/", "default");
ctxt.addMimeMapping("html", "text/html");
tomcat.start();
@@ -391,7 +391,7 @@ public class TestDefaultServlet extends TomcatBaseTest {
DefaultServlet.class.getName());
defaultServlet.addInitParameter("precompressed", "true");
- ctxt.addServletMappingDecoded("/", "default");
+ ctxt.addServletMapping("/", "default");
ctxt.addMimeMapping("html", "text/html");
tomcat.start();
@@ -454,9 +454,9 @@ public class TestDefaultServlet extends TomcatBaseTest {
// Override the default servlet with our own mappings
Tomcat.addServlet(ctx, "default2", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default2");
- ctx.addServletMappingDecoded("/servlets/*", "default2");
- ctx.addServletMappingDecoded("/static/*", "default2");
+ ctx.addServletMapping("/", "default2");
+ ctx.addServletMapping("/servlets/*", "default2");
+ ctx.addServletMapping("/static/*", "default2");
tomcat.start();
@@ -524,7 +524,7 @@ public class TestDefaultServlet extends TomcatBaseTest {
DefaultServlet.class.getName());
defaultServlet.addInitParameter("fileEncoding", "ISO-8859-1");
- ctxt.addServletMappingDecoded("/", "default");
+ ctxt.addServletMapping("/", "default");
ctxt.addMimeMapping("html", "text/html");
ErrorPage ep = new ErrorPage();
ep.setErrorCode(404);
@@ -709,7 +709,7 @@ public class TestDefaultServlet extends TomcatBaseTest {
defaultServlet.addInitParameter("listings", "true");
defaultServlet.addInitParameter("localXsltFile", "_listing.xslt");
- ctxt.addServletMappingDecoded("/", "default");
+ ctxt.addServletMapping("/", "default");
tomcat.start();
@@ -741,7 +741,7 @@ public class TestDefaultServlet extends TomcatBaseTest {
defaultServlet.addInitParameter("sortListings", "true");
defaultServlet.addInitParameter("sortDirectoriesFirst", "true");
- ctxt.addServletMappingDecoded("/", "default");
+ ctxt.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/catalina/servlets/TestDefaultServletIfMatchRequests.java b/test/org/apache/catalina/servlets/TestDefaultServletIfMatchRequests.java
index bcfa359388..40815a3b7d 100644
--- a/test/org/apache/catalina/servlets/TestDefaultServletIfMatchRequests.java
+++ b/test/org/apache/catalina/servlets/TestDefaultServletIfMatchRequests.java
@@ -178,7 +178,7 @@ public class TestDefaultServletIfMatchRequests extends TomcatBaseTest {
if (resourceHasStrongETag) {
wrapper.addInitParameter("useStrongETags", "true");
}
- ctxt.addServletMappingDecoded("/", "default");
+ ctxt.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/catalina/servlets/TestDefaultServletPut.java b/test/org/apache/catalina/servlets/TestDefaultServletPut.java
index 2b2d159bae..45696e74cc 100644
--- a/test/org/apache/catalina/servlets/TestDefaultServletPut.java
+++ b/test/org/apache/catalina/servlets/TestDefaultServletPut.java
@@ -130,7 +130,7 @@ public class TestDefaultServletPut extends TomcatBaseTest {
Wrapper w = Tomcat.addServlet(ctxt, "default", DefaultServlet.class.getName());
w.addInitParameter("readonly", "false");
w.addInitParameter("allowPartialPut", Boolean.toString(allowPartialPut));
- ctxt.addServletMappingDecoded("/", "default");
+ ctxt.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/catalina/servlets/TestDefaultServletRangeRequests.java b/test/org/apache/catalina/servlets/TestDefaultServletRangeRequests.java
index f560a2af20..dd77083de2 100644
--- a/test/org/apache/catalina/servlets/TestDefaultServletRangeRequests.java
+++ b/test/org/apache/catalina/servlets/TestDefaultServletRangeRequests.java
@@ -171,7 +171,7 @@ public class TestDefaultServletRangeRequests extends TomcatBaseTest {
if (ifRangeHeader != null && ifRangeHeader.startsWith("\"")) {
wrapper.addInitParameter("useStrongETags", "true");
}
- ctxt.addServletMappingDecoded("/", "default");
+ ctxt.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section13.java b/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section13.java
index 1f469c27c9..24f6baa99b 100644
--- a/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section13.java
+++ b/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section13.java
@@ -577,7 +577,7 @@ public class TestDefaultServletRfc9110Section13 extends TomcatBaseTest {
w.addInitParameter("readonly", "false");
w.addInitParameter("allowPartialPut", "true");
w.addInitParameter("useStrongETags", Boolean.toString(useStrongETags));
- ctxt.addServletMappingDecoded("/", "default");
+ ctxt.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section14.java b/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section14.java
index 91aa5b3df2..34394ab0e9 100644
--- a/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section14.java
+++ b/test/org/apache/catalina/servlets/TestDefaultServletRfc9110Section14.java
@@ -45,7 +45,7 @@ public class TestDefaultServletRfc9110Section14 extends TomcatBaseTest {
Context ctxt = tomcat.addContext("", appDir.getAbsolutePath());
Tomcat.addServlet(ctxt, "default", DefaultServlet.class.getName());
- ctxt.addServletMappingDecoded("/", "default");
+ ctxt.addServletMapping("/", "default");
tomcat.start();
@@ -80,7 +80,7 @@ public class TestDefaultServletRfc9110Section14 extends TomcatBaseTest {
Context ctxt = tomcat.addContext("", appDir.getAbsolutePath());
Tomcat.addServlet(ctxt, "default", DefaultServlet.class.getName());
- ctxt.addServletMappingDecoded("/", "default");
+ ctxt.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/catalina/servlets/TestWebdavServlet.java b/test/org/apache/catalina/servlets/TestWebdavServlet.java
index d69e5ea7a5..a888c20185 100644
--- a/test/org/apache/catalina/servlets/TestWebdavServlet.java
+++ b/test/org/apache/catalina/servlets/TestWebdavServlet.java
@@ -96,10 +96,10 @@ public class TestWebdavServlet extends TomcatBaseTest {
String contextPath="";
if (useSubpathWebdav) {
- ctx.addServletMappingDecoded("/webdav/*", "webdav");
+ ctx.addServletMapping("/webdav/*", "webdav");
contextPath = "/webdav";
} else {
- ctx.addServletMappingDecoded("/*", "webdav");
+ ctx.addServletMapping("/*", "webdav");
}
tomcat.start();
@@ -145,7 +145,7 @@ public class TestWebdavServlet extends TomcatBaseTest {
Context ctx = tomcat.addWebapp(null, "/examples", appDir.getAbsolutePath());
Tomcat.addServlet(ctx, "webdav", new WebdavServlet());
- ctx.addServletMappingDecoded("/webdav/*", "webdav");
+ ctx.addServletMapping("/webdav/*", "webdav");
ctx.addApplicationListener(WsContextListener.class.getName());
tomcat.start();
@@ -215,7 +215,7 @@ public class TestWebdavServlet extends TomcatBaseTest {
Wrapper defaultServlet = Tomcat.addServlet(ctxt, "webdav", new WebdavServlet());
defaultServlet.addInitParameter("listings", "true");
- ctxt.addServletMappingDecoded("/*", "webdav");
+ ctxt.addServletMapping("/*", "webdav");
ctxt.addMimeMapping("html", "text/html");
tomcat.start();
@@ -304,7 +304,7 @@ public class TestWebdavServlet extends TomcatBaseTest {
webdavServlet.addInitParameter("listings", "true");
webdavServlet.addInitParameter("secret", "foo");
webdavServlet.addInitParameter("readonly", "false");
- ctxt.addServletMappingDecoded("/*", "webdav");
+ ctxt.addServletMapping("/*", "webdav");
ctxt.addMimeMapping("txt", "text/plain");
tomcat.start();
@@ -450,7 +450,7 @@ public class TestWebdavServlet extends TomcatBaseTest {
webdavServlet.addInitParameter("secret", "foo");
webdavServlet.addInitParameter("readonly", "false");
webdavServlet.addInitParameter("useStrongETags", "true");
- ctxt.addServletMappingDecoded("/*", "webdav");
+ ctxt.addServletMapping("/*", "webdav");
tomcat.start();
ctxt.getResources().setCacheMaxSize(10);
@@ -936,7 +936,7 @@ public class TestWebdavServlet extends TomcatBaseTest {
webdavServlet.addInitParameter("listings", "true");
webdavServlet.addInitParameter("readonly", "false");
webdavServlet.addInitParameter("serveSubpathOnly", "true");
- ctxt.addServletMappingDecoded("/aaa/*", "webdav");
+ ctxt.addServletMapping("/aaa/*", "webdav");
tomcat.start();
ctxt.getResources().setCacheMaxSize(10);
@@ -1031,7 +1031,7 @@ public class TestWebdavServlet extends TomcatBaseTest {
webdavServlet.addInitParameter("listings", "true");
webdavServlet.addInitParameter("secret", "foo");
webdavServlet.addInitParameter("readonly", "false");
- ctxt.addServletMappingDecoded("/*", "webdav");
+ ctxt.addServletMapping("/*", "webdav");
tomcat.start();
Client client = new Client();
@@ -1428,7 +1428,7 @@ public class TestWebdavServlet extends TomcatBaseTest {
webdavServlet.addInitParameter("listings", "true");
webdavServlet.addInitParameter("secret", "foo");
webdavServlet.addInitParameter("readonly", "false");
- ctxt.addServletMappingDecoded("/*", "webdav");
+ ctxt.addServletMapping("/*", "webdav");
tomcat.start();
Client client = new Client();
@@ -1553,7 +1553,7 @@ public class TestWebdavServlet extends TomcatBaseTest {
webdavServlet.addInitParameter("propertyStore", "org.apache.catalina.servlets.TestWebdavServlet$CustomPropertyStore");
webdavServlet.addInitParameter("store.propertyName", "mytestproperty");
webdavServlet.addInitParameter("store.propertyValue", "testvalue");
- ctxt.addServletMappingDecoded("/*", "webdav");
+ ctxt.addServletMapping("/*", "webdav");
ctxt.addMimeMapping("txt", "text/plain");
tomcat.start();
@@ -1608,7 +1608,7 @@ public class TestWebdavServlet extends TomcatBaseTest {
webdavServlet.addInitParameter("useStrongETags", "true");
webdavServlet.addInitParameter("maxRequestBodySize", "10");
- ctxt.addServletMappingDecoded("/*", "webdav");
+ ctxt.addServletMapping("/*", "webdav");
tomcat.start();
// With content length
diff --git a/test/org/apache/catalina/session/TestPersistentManagerIntegration.java b/test/org/apache/catalina/session/TestPersistentManagerIntegration.java
index 7aaa369378..c8ffeeaf6f 100644
--- a/test/org/apache/catalina/session/TestPersistentManagerIntegration.java
+++ b/test/org/apache/catalina/session/TestPersistentManagerIntegration.java
@@ -102,7 +102,7 @@ public class TestPersistentManagerIntegration extends TomcatBaseTest {
ctx.setDistributable(true);
Tomcat.addServlet(ctx, "DummyServlet", new DummyServlet());
- ctx.addServletMappingDecoded("/dummy", "DummyServlet");
+ ctx.addServletMapping("/dummy", "DummyServlet");
PersistentManager manager = new PersistentManager();
TesterStore store = new TesterStore();
@@ -134,7 +134,7 @@ public class TestPersistentManagerIntegration extends TomcatBaseTest {
ctx.setDistributable(true);
Tomcat.addServlet(ctx, "DummyServlet", new DummyServlet());
- ctx.addServletMappingDecoded("/dummy", "DummyServlet");
+ ctx.addServletMapping("/dummy", "DummyServlet");
PersistentManager manager = new PersistentManager();
TesterStore store = new TesterStore();
@@ -166,7 +166,7 @@ public class TestPersistentManagerIntegration extends TomcatBaseTest {
ctx.setDistributable(true);
Tomcat.addServlet(ctx, "DummyServlet", new DummyServlet());
- ctx.addServletMappingDecoded("/dummy", "DummyServlet");
+ ctx.addServletMapping("/dummy", "DummyServlet");
PersistentManager manager = new PersistentManager();
TesterStore store = new TesterStore();
diff --git a/test/org/apache/catalina/session/TestStandardSessionIntegration.java b/test/org/apache/catalina/session/TestStandardSessionIntegration.java
index 2606ff809a..e7b0b5c7a4 100644
--- a/test/org/apache/catalina/session/TestStandardSessionIntegration.java
+++ b/test/org/apache/catalina/session/TestStandardSessionIntegration.java
@@ -59,7 +59,7 @@ public class TestStandardSessionIntegration extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "bug56578", new Bug56578Servlet());
- ctx.addServletMappingDecoded("/bug56578", "bug56578");
+ ctx.addServletMapping("/bug56578", "bug56578");
if (useClustering) {
SimpleTcpCluster cluster = new SimpleTcpCluster();
diff --git a/test/org/apache/catalina/ssi/TestRegExpCapture.java b/test/org/apache/catalina/ssi/TestRegExpCapture.java
index d190cf206f..9a5ca501cf 100644
--- a/test/org/apache/catalina/ssi/TestRegExpCapture.java
+++ b/test/org/apache/catalina/ssi/TestRegExpCapture.java
@@ -76,7 +76,7 @@ public class TestRegExpCapture extends TomcatBaseTest {
ssiFilter.setFilterClass(SSIFilter.class.getName());
FilterMap ssiFilterMap = new FilterMap();
ssiFilterMap.setFilterName("ssiFilter");
- ssiFilterMap.addURLPatternDecoded("*.shtml");
+ ssiFilterMap.addURLPattern("*.shtml");
ctx.addFilterDef(ssiFilter);
ctx.addFilterMap(ssiFilterMap);
diff --git a/test/org/apache/catalina/ssi/TestSsiServlet.java b/test/org/apache/catalina/ssi/TestSsiServlet.java
index d4fb49420a..251cc6957b 100644
--- a/test/org/apache/catalina/ssi/TestSsiServlet.java
+++ b/test/org/apache/catalina/ssi/TestSsiServlet.java
@@ -44,11 +44,11 @@ public class TestSsiServlet extends TomcatBaseTest {
Context ctxt = tomcat.addContext("", appDir.getAbsolutePath());
Tomcat.addServlet(ctxt, "default", new DefaultServlet());
- ctxt.addServletMappingDecoded("/", "default");
+ ctxt.addServletMapping("/", "default");
Wrapper ssi = Tomcat.addServlet(ctxt, "ssi", new SSIServlet());
ssi.addInitParameter("allowExec", "true");
- ctxt.addServletMappingDecoded("*.shtml", "ssi");
+ ctxt.addServletMapping("*.shtml", "ssi");
tomcat.start();
diff --git a/test/org/apache/catalina/startup/EmbeddedTomcat.java b/test/org/apache/catalina/startup/EmbeddedTomcat.java
index f8c86492b2..1f36f3424c 100644
--- a/test/org/apache/catalina/startup/EmbeddedTomcat.java
+++ b/test/org/apache/catalina/startup/EmbeddedTomcat.java
@@ -69,7 +69,7 @@ public class EmbeddedTomcat {
skipTldsForResourceJars(ctx);
CounterServlet counterServlet = new CounterServlet();
Tomcat.addServlet(ctx, "counterServlet", counterServlet);
- ctx.addServletMappingDecoded("/", "counterServlet");
+ ctx.addServletMapping("/", "counterServlet");
//ctx.addApplicationListener(new WsContextListener());
tomcat.start();
diff --git a/test/org/apache/catalina/startup/TestContextConfig.java b/test/org/apache/catalina/startup/TestContextConfig.java
index 2d9475fcbc..e935a47869 100644
--- a/test/org/apache/catalina/startup/TestContextConfig.java
+++ b/test/org/apache/catalina/startup/TestContextConfig.java
@@ -112,7 +112,7 @@ public class TestContextConfig extends TomcatBaseTest {
Tomcat.addServlet(context, "TestServlet",
"org.apache.catalina.startup.TesterServletWithLifeCycleMethods");
- context.addServletMappingDecoded("/testServlet", "TestServlet");
+ context.addServletMapping("/testServlet", "TestServlet");
tomcat.enableNaming();
@@ -131,7 +131,7 @@ public class TestContextConfig extends TomcatBaseTest {
Tomcat.addServlet(context, "TestServlet",
"org.apache.catalina.startup.TesterServletWithAnnotations");
- context.addServletMappingDecoded("/testServlet", "TestServlet");
+ context.addServletMapping("/testServlet", "TestServlet");
tomcat.enableNaming();
diff --git a/test/org/apache/catalina/startup/TestContextConfigAnnotation.java b/test/org/apache/catalina/startup/TestContextConfigAnnotation.java
index ff08fb04a4..55d080a4c5 100644
--- a/test/org/apache/catalina/startup/TestContextConfigAnnotation.java
+++ b/test/org/apache/catalina/startup/TestContextConfigAnnotation.java
@@ -211,7 +211,7 @@ public class TestContextConfigAnnotation {
webxml.addFilter(filterDef);
FilterMap filterMap = new FilterMap();
- filterMap.addURLPatternDecoded("/param1");
+ filterMap.addURLPattern("/param1");
filterMap.setFilterName("paramFilter");
webxml.addFilterMapping(filterMap);
diff --git a/test/org/apache/catalina/startup/TestPropertySources.java b/test/org/apache/catalina/startup/TestPropertySources.java
index bc9cae4353..b560dbc2f6 100644
--- a/test/org/apache/catalina/startup/TestPropertySources.java
+++ b/test/org/apache/catalina/startup/TestPropertySources.java
@@ -99,7 +99,7 @@ public class TestPropertySources extends LoggingBaseTest {
Context ctx = tomcat.addContext("", null);
Tomcat.addServlet(ctx, "myServlet", new HelloWorld());
- ctx.addServletMappingDecoded("/", "myServlet");
+ ctx.addServletMapping("/", "myServlet");
tomcat.start();
diff --git a/test/org/apache/catalina/startup/TestStartupIPv6Connectors.java b/test/org/apache/catalina/startup/TestStartupIPv6Connectors.java
index 593b314053..22d36ff852 100644
--- a/test/org/apache/catalina/startup/TestStartupIPv6Connectors.java
+++ b/test/org/apache/catalina/startup/TestStartupIPv6Connectors.java
@@ -139,7 +139,7 @@ public class TestStartupIPv6Connectors extends TomcatBaseTest {
tomcat.setBaseDir(baseDir.getAbsolutePath());
Context context = tomcat.addContext("", null);
Tomcat.addServlet(context, "simple", new HelloWorldServlet());
- context.addServletMappingDecoded("/", "simple");
+ context.addServletMapping("/", "simple");
try {
tomcat.start();
diff --git a/test/org/apache/catalina/startup/TestTomcat.java b/test/org/apache/catalina/startup/TestTomcat.java
index 02920924d4..77ebe03c25 100644
--- a/test/org/apache/catalina/startup/TestTomcat.java
+++ b/test/org/apache/catalina/startup/TestTomcat.java
@@ -192,7 +192,7 @@ public class TestTomcat extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "myServlet", new HelloWorld());
- ctx.addServletMappingDecoded("/", "myServlet");
+ ctx.addServletMapping("/", "myServlet");
tomcat.start();
@@ -243,7 +243,7 @@ public class TestTomcat extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "myServlet", new HelloWorldSession());
- ctx.addServletMappingDecoded("/", "myServlet");
+ ctx.addServletMapping("/", "myServlet");
tomcat.start();
@@ -282,7 +282,7 @@ public class TestTomcat extends TomcatBaseTest {
ctx.getNamingResources().addEnvironment(environment);
Tomcat.addServlet(ctx, "jndiServlet", new HelloWorldJndi());
- ctx.addServletMappingDecoded("/", "jndiServlet");
+ ctx.addServletMapping("/", "jndiServlet");
tomcat.start();
@@ -316,7 +316,7 @@ public class TestTomcat extends TomcatBaseTest {
ctx.getNamingResources().addResourceLink(link);
Tomcat.addServlet(ctx, "jndiServlet", new HelloWorldJndi());
- ctx.addServletMappingDecoded("/", "jndiServlet");
+ ctx.addServletMapping("/", "jndiServlet");
tomcat.start();
@@ -341,7 +341,7 @@ public class TestTomcat extends TomcatBaseTest {
ctx.addApplicationListener(WsContextListener.class.getName());
Tomcat.addServlet(ctx, "testGetResource", new GetResource());
- ctx.addServletMappingDecoded("/testGetResource", "testGetResource");
+ ctx.addServletMapping("/testGetResource", "testGetResource");
tomcat.start();
@@ -381,7 +381,7 @@ public class TestTomcat extends TomcatBaseTest {
InitCount initCount = new InitCount();
Tomcat.addServlet(ctx, "initCount", initCount);
- ctx.addServletMappingDecoded("/", "initCount");
+ ctx.addServletMapping("/", "initCount");
tomcat.start();
diff --git a/test/org/apache/catalina/startup/TestTomcatClassLoader.java b/test/org/apache/catalina/startup/TestTomcatClassLoader.java
index 0586307865..dda9c77087 100644
--- a/test/org/apache/catalina/startup/TestTomcatClassLoader.java
+++ b/test/org/apache/catalina/startup/TestTomcatClassLoader.java
@@ -43,7 +43,7 @@ public class TestTomcatClassLoader extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "ClassLoaderReport", new ClassLoaderReport(null));
- ctx.addServletMappingDecoded("/", "ClassLoaderReport");
+ ctx.addServletMapping("/", "ClassLoaderReport");
tomcat.start();
@@ -65,7 +65,7 @@ public class TestTomcatClassLoader extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "ClassLoaderReport", new ClassLoaderReport(cl));
- ctx.addServletMappingDecoded("/", "ClassLoaderReport");
+ ctx.addServletMapping("/", "ClassLoaderReport");
tomcat.start();
diff --git a/test/org/apache/catalina/startup/TestTomcatStandalone.java b/test/org/apache/catalina/startup/TestTomcatStandalone.java
index f3abbf1fa2..a7323efe60 100644
--- a/test/org/apache/catalina/startup/TestTomcatStandalone.java
+++ b/test/org/apache/catalina/startup/TestTomcatStandalone.java
@@ -170,7 +170,7 @@ public class TestTomcatStandalone extends LoggingBaseTest {
Context ctx = tomcat.addContext("", null);
Tomcat.addServlet(ctx, "myServlet", new HelloWorld());
- ctx.addServletMappingDecoded("/", "myServlet");
+ ctx.addServletMapping("/", "myServlet");
tomcat.start();
// Emulate Tomcat main thread
diff --git a/test/org/apache/catalina/valves/TestAccessLogValve.java b/test/org/apache/catalina/valves/TestAccessLogValve.java
index 81691cd1c1..5b5bfde1d1 100644
--- a/test/org/apache/catalina/valves/TestAccessLogValve.java
+++ b/test/org/apache/catalina/valves/TestAccessLogValve.java
@@ -280,7 +280,7 @@ public class TestAccessLogValve extends TomcatBaseTest {
// Map the test Servlet
TesterServlet servlet = new TesterServlet();
Tomcat.addServlet(ctx, "servlet", servlet);
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
CharArrayWriter writer = new CharArrayWriter();
if (TEXT_TYPE.equals(type)) {
diff --git a/test/org/apache/catalina/valves/TestAccessLogValveFile.java b/test/org/apache/catalina/valves/TestAccessLogValveFile.java
index e0aa3bfa6d..7b76ffc583 100644
--- a/test/org/apache/catalina/valves/TestAccessLogValveFile.java
+++ b/test/org/apache/catalina/valves/TestAccessLogValveFile.java
@@ -239,7 +239,7 @@ public class TestAccessLogValveFile extends TomcatBaseTest {
Tomcat tomcat = getTomcatInstance();
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "hello", new HelloWorldServlet());
- ctx.addServletMappingDecoded("/", "hello");
+ ctx.addServletMapping("/", "hello");
logDir = getLogDir();
AccessLogValve valve = new AccessLogValve();
diff --git a/test/org/apache/catalina/valves/TestErrorReportValve.java b/test/org/apache/catalina/valves/TestErrorReportValve.java
index 50b341ad1b..e5b3eed964 100644
--- a/test/org/apache/catalina/valves/TestErrorReportValve.java
+++ b/test/org/apache/catalina/valves/TestErrorReportValve.java
@@ -51,7 +51,7 @@ public class TestErrorReportValve extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "errorServlet", new ErrorServlet());
- ctx.addServletMappingDecoded("/", "errorServlet");
+ ctx.addServletMapping("/", "errorServlet");
tomcat.start();
@@ -84,7 +84,7 @@ public class TestErrorReportValve extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "bug54220", new Bug54220Servlet(false));
- ctx.addServletMappingDecoded("/", "bug54220");
+ ctx.addServletMapping("/", "bug54220");
tomcat.start();
@@ -104,7 +104,7 @@ public class TestErrorReportValve extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "bug54220", new Bug54220Servlet(true));
- ctx.addServletMappingDecoded("/", "bug54220");
+ ctx.addServletMapping("/", "bug54220");
tomcat.start();
@@ -147,7 +147,7 @@ public class TestErrorReportValve extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "bug54536", new Bug54536Servlet());
- ctx.addServletMappingDecoded("/", "bug54536");
+ ctx.addServletMapping("/", "bug54536");
tomcat.start();
@@ -184,7 +184,7 @@ public class TestErrorReportValve extends TomcatBaseTest {
Bug56042Servlet bug56042Servlet = new Bug56042Servlet();
Wrapper wrapper = Tomcat.addServlet(ctx, "bug56042Servlet", bug56042Servlet);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/bug56042Servlet", "bug56042Servlet");
+ ctx.addServletMapping("/bug56042Servlet", "bug56042Servlet");
tomcat.start();
@@ -245,9 +245,9 @@ public class TestErrorReportValve extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "exception", new ExceptionServlet());
- ctx.addServletMappingDecoded("/exception", "exception");
+ ctx.addServletMapping("/exception", "exception");
Tomcat.addServlet(ctx, "erropage", new ErrorPageServlet());
- ctx.addServletMappingDecoded("/erropage", "erropage");
+ ctx.addServletMapping("/erropage", "erropage");
ErrorPage errorPage = new ErrorPage();
errorPage.setErrorCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
errorPage.setLocation("/erropage");
diff --git a/test/org/apache/catalina/valves/TestExtendedAccessLogValve.java b/test/org/apache/catalina/valves/TestExtendedAccessLogValve.java
index 6cee0ea086..a883d2b4d2 100644
--- a/test/org/apache/catalina/valves/TestExtendedAccessLogValve.java
+++ b/test/org/apache/catalina/valves/TestExtendedAccessLogValve.java
@@ -126,7 +126,7 @@ public class TestExtendedAccessLogValve extends TomcatBaseTest {
resp.getWriter().write("Test response");
}
});
- ctx.addServletMappingDecoded("/test", "testServlet");
+ ctx.addServletMapping("/test", "testServlet");
tomcat.start();
diff --git a/test/org/apache/catalina/valves/TestJsonErrorReportValve.java b/test/org/apache/catalina/valves/TestJsonErrorReportValve.java
index 95d1369721..183498078e 100644
--- a/test/org/apache/catalina/valves/TestJsonErrorReportValve.java
+++ b/test/org/apache/catalina/valves/TestJsonErrorReportValve.java
@@ -55,7 +55,7 @@ public class TestJsonErrorReportValve extends TomcatBaseTest {
Tomcat.addServlet(ctx, "sendError", new SendErrorServlet(
HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Server broke"));
- ctx.addServletMappingDecoded("/", "sendError");
+ ctx.addServletMapping("/", "sendError");
tomcat.start();
@@ -92,7 +92,7 @@ public class TestJsonErrorReportValve extends TomcatBaseTest {
Tomcat.addServlet(ctx, "exception",
new ExceptionServlet("Something went wrong"));
- ctx.addServletMappingDecoded("/", "exception");
+ ctx.addServletMapping("/", "exception");
tomcat.start();
@@ -136,7 +136,7 @@ public class TestJsonErrorReportValve extends TomcatBaseTest {
String specialMessage = "Error with \"quotes\" and \\backslash\\";
Tomcat.addServlet(ctx, "specialChars", new SendErrorServlet(
HttpServletResponse.SC_INTERNAL_SERVER_ERROR, specialMessage));
- ctx.addServletMappingDecoded("/", "specialChars");
+ ctx.addServletMapping("/", "specialChars");
tomcat.start();
@@ -171,7 +171,7 @@ public class TestJsonErrorReportValve extends TomcatBaseTest {
Tomcat.addServlet(ctx, "customError",
new SendErrorServlet(999, "The sky is falling"));
- ctx.addServletMappingDecoded("/", "customError");
+ ctx.addServletMapping("/", "customError");
tomcat.start();
@@ -200,7 +200,7 @@ public class TestJsonErrorReportValve extends TomcatBaseTest {
Tomcat.addServlet(ctx, "notFound", new SendErrorServlet(
HttpServletResponse.SC_NOT_FOUND, "Resource not found"));
- ctx.addServletMappingDecoded("/", "notFound");
+ ctx.addServletMapping("/", "notFound");
tomcat.start();
@@ -231,7 +231,7 @@ public class TestJsonErrorReportValve extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "chained", new ChainedExceptionServlet());
- ctx.addServletMappingDecoded("/", "chained");
+ ctx.addServletMapping("/", "chained");
tomcat.start();
@@ -270,7 +270,7 @@ public class TestJsonErrorReportValve extends TomcatBaseTest {
Tomcat.addServlet(ctx, "noMessage", new SendErrorServlet(
HttpServletResponse.SC_INTERNAL_SERVER_ERROR, null));
- ctx.addServletMappingDecoded("/", "noMessage");
+ ctx.addServletMapping("/", "noMessage");
tomcat.start();
@@ -297,7 +297,7 @@ public class TestJsonErrorReportValve extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "hello", new HelloWorldServlet());
- ctx.addServletMappingDecoded("/", "hello");
+ ctx.addServletMapping("/", "hello");
tomcat.start();
@@ -321,7 +321,7 @@ public class TestJsonErrorReportValve extends TomcatBaseTest {
String unicodeMessage = "Error: \u00e9\u00e8\u00ea \u4e2d\u6587 \u00f1";
Tomcat.addServlet(ctx, "unicode", new SendErrorServlet(
HttpServletResponse.SC_INTERNAL_SERVER_ERROR, unicodeMessage));
- ctx.addServletMappingDecoded("/", "unicode");
+ ctx.addServletMapping("/", "unicode");
tomcat.start();
@@ -349,7 +349,7 @@ public class TestJsonErrorReportValve extends TomcatBaseTest {
Tomcat.addServlet(ctx, "sendError", new SendErrorServlet(
HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Server broke"));
- ctx.addServletMappingDecoded("/", "sendError");
+ ctx.addServletMapping("/", "sendError");
tomcat.start();
@@ -385,7 +385,7 @@ public class TestJsonErrorReportValve extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "exception", new ExceptionServlet("Something went wrong"));
- ctx.addServletMappingDecoded("/", "exception");
+ ctx.addServletMapping("/", "exception");
tomcat.start();
@@ -420,7 +420,7 @@ public class TestJsonErrorReportValve extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "unknownNoMessage", new SendErrorServlet(999, null));
- ctx.addServletMappingDecoded("/", "unknownNoMessage");
+ ctx.addServletMapping("/", "unknownNoMessage");
tomcat.start();
diff --git a/test/org/apache/catalina/valves/TestParameterLimitValve.java b/test/org/apache/catalina/valves/TestParameterLimitValve.java
index 6af2c92c61..16a7f74bc6 100644
--- a/test/org/apache/catalina/valves/TestParameterLimitValve.java
+++ b/test/org/apache/catalina/valves/TestParameterLimitValve.java
@@ -63,7 +63,7 @@ public class TestParameterLimitValve extends TomcatBaseTest {
parameterLimitValve.setUrlPatternLimits("/special/.*=2");
Tomcat.addServlet(ctx, "snoop", new SnoopServlet());
- ctx.addServletMappingDecoded("/special/endpoint", "snoop");
+ ctx.addServletMapping("/special/endpoint", "snoop");
addFailedRequestFilter(ctx);
@@ -139,7 +139,7 @@ public class TestParameterLimitValve extends TomcatBaseTest {
parameterLimitValve.setUrlPatternLimits("/special====2");
Tomcat.addServlet(ctx, "snoop", new SnoopServlet());
- ctx.addServletMappingDecoded("/special===", "snoop");
+ ctx.addServletMapping("/special===", "snoop");
addFailedRequestFilter(ctx);
@@ -162,7 +162,7 @@ public class TestParameterLimitValve extends TomcatBaseTest {
parameterLimitValve.setUrlPatternLimits("/special%20endpoint=2");
Tomcat.addServlet(ctx, "snoop", new SnoopServlet());
- ctx.addServletMappingDecoded("/special endpoint", "snoop");
+ ctx.addServletMapping("/special endpoint", "snoop");
addFailedRequestFilter(ctx);
@@ -189,10 +189,10 @@ public class TestParameterLimitValve extends TomcatBaseTest {
.setUrlPatternLimits("/special/.*=2" + CRLF + "/special2/.*=3" + CRLF + "/my/special/url1=1");
Tomcat.addServlet(ctx, "snoop", new SnoopServlet());
- ctx.addServletMappingDecoded("/special/endpoint", "snoop");
- ctx.addServletMappingDecoded("/special2/endpoint", "snoop");
- ctx.addServletMappingDecoded("/my/special/url1", "snoop");
- ctx.addServletMappingDecoded("/my/special/url2", "snoop");
+ ctx.addServletMapping("/special/endpoint", "snoop");
+ ctx.addServletMapping("/special2/endpoint", "snoop");
+ ctx.addServletMapping("/my/special/url1", "snoop");
+ ctx.addServletMapping("/my/special/url2", "snoop");
addFailedRequestFilter(ctx);
@@ -245,7 +245,7 @@ public class TestParameterLimitValve extends TomcatBaseTest {
parameterLimitValve.setUrlPatternLimits("/special/.*=2");
Tomcat.addServlet(ctx, "snoop", new SnoopServlet());
- ctx.addServletMappingDecoded("/other/endpoint", "snoop");
+ ctx.addServletMapping("/other/endpoint", "snoop");
addFailedRequestFilter(ctx);
@@ -278,7 +278,7 @@ public class TestParameterLimitValve extends TomcatBaseTest {
}
Tomcat.addServlet(ctx, "snoop", new SnoopServlet());
- ctx.addServletMappingDecoded("/api/test", "snoop");
+ ctx.addServletMapping("/api/test", "snoop");
addFailedRequestFilter(ctx);
@@ -308,7 +308,7 @@ public class TestParameterLimitValve extends TomcatBaseTest {
}
Tomcat.addServlet(ctx, "snoop", new SnoopServlet());
- ctx.addServletMappingDecoded("/api/test", "snoop");
+ ctx.addServletMapping("/api/test", "snoop");
addFailedRequestFilter(ctx);
@@ -341,8 +341,8 @@ public class TestParameterLimitValve extends TomcatBaseTest {
}
Tomcat.addServlet(ctx, "snoop", new SnoopServlet());
- ctx.addServletMappingDecoded("/api/test", "snoop");
- ctx.addServletMappingDecoded("/admin/test", "snoop");
+ ctx.addServletMapping("/api/test", "snoop");
+ ctx.addServletMapping("/admin/test", "snoop");
addFailedRequestFilter(ctx);
@@ -375,7 +375,7 @@ public class TestParameterLimitValve extends TomcatBaseTest {
parameterLimitValve.setUrlPatternLimits("/.*=2");
Tomcat.addServlet(ctx, "snoop", new SnoopServlet());
- ctx.addServletMappingDecoded("/special/endpoint", "snoop");
+ ctx.addServletMapping("/special/endpoint", "snoop");
addFailedRequestFilter(ctx);
@@ -419,13 +419,13 @@ public class TestParameterLimitValve extends TomcatBaseTest {
context3ParameterLimitValve.setUrlPatternLimits("/special/.*=1");
Tomcat.addServlet(ctx1, "snoop", new SnoopServlet());
- ctx1.addServletMappingDecoded("/special/endpoint", "snoop");
+ ctx1.addServletMapping("/special/endpoint", "snoop");
Tomcat.addServlet(ctx2, "snoop", new SnoopServlet());
- ctx2.addServletMappingDecoded("/special/endpoint", "snoop");
+ ctx2.addServletMapping("/special/endpoint", "snoop");
Tomcat.addServlet(ctx3, "snoop", new SnoopServlet());
- ctx3.addServletMappingDecoded("/special/endpoint", "snoop");
+ ctx3.addServletMapping("/special/endpoint", "snoop");
addFailedRequestFilter(ctx1);
addFailedRequestFilter(ctx2);
@@ -493,7 +493,7 @@ public class TestParameterLimitValve extends TomcatBaseTest {
Wrapper w = Tomcat.addServlet(ctx, "multipart", new MultipartServlet());
// Use defaults for Multipart
w.setMultipartConfigElement(new MultipartConfigElement(""));
- ctx.addServletMappingDecoded("/upload/*", "multipart");
+ ctx.addServletMapping("/upload/*", "multipart");
addFailedRequestFilter(ctx);
@@ -606,7 +606,7 @@ public class TestParameterLimitValve extends TomcatBaseTest {
Wrapper w = Tomcat.addServlet(ctx, "multipart", new MultipartServlet());
// Use defaults for Multipart
w.setMultipartConfigElement(new MultipartConfigElement(""));
- ctx.addServletMappingDecoded("/upload/*", "multipart");
+ ctx.addServletMapping("/upload/*", "multipart");
addFailedRequestFilter(ctx);
diff --git a/test/org/apache/catalina/valves/TestPersistentValveAsync.java b/test/org/apache/catalina/valves/TestPersistentValveAsync.java
index 4c483d2dad..4214827673 100644
--- a/test/org/apache/catalina/valves/TestPersistentValveAsync.java
+++ b/test/org/apache/catalina/valves/TestPersistentValveAsync.java
@@ -61,7 +61,7 @@ public class TestPersistentValveAsync extends TomcatBaseTest {
Wrapper wrapper = Tomcat.addServlet(context, "async-complete", new AsyncCompleteServlet());
wrapper.setAsyncSupported(true);
- context.addServletMappingDecoded("/async-complete", "async-complete");
+ context.addServletMapping("/async-complete", "async-complete");
TesterStore store = new TesterStore();
PersistentManager manager = configurePersistentManager(context, store, new PersistentValve());
@@ -85,7 +85,7 @@ public class TestPersistentValveAsync extends TomcatBaseTest {
Wrapper wrapper = Tomcat.addServlet(context, "async-dispatch", new AsyncDispatchServlet());
wrapper.setAsyncSupported(true);
- context.addServletMappingDecoded("/async-dispatch", "async-dispatch");
+ context.addServletMapping("/async-dispatch", "async-dispatch");
TesterStore store = new TesterStore();
PersistentManager manager = configurePersistentManager(context, store, new PersistentValve());
@@ -140,7 +140,7 @@ public class TestPersistentValveAsync extends TomcatBaseTest {
StandardContext context = addSemaphoreTestServlets("async-error",
new ErrorDispatchingAsyncServlet(asyncStarted, allowAsyncError), "/async-error");
Tomcat.addServlet(context, "async-error-target", new ErrorServlet());
- context.addServletMappingDecoded("/async-error-target", "async-error-target");
+ context.addServletMapping("/async-error-target", "async-error-target");
tomcat.start();
assertSemaphoreHeldUntilAsyncRequestCompletes("/async-error", asyncStarted, allowAsyncError,
@@ -178,11 +178,11 @@ public class TestPersistentValveAsync extends TomcatBaseTest {
context.setDistributable(true);
Tomcat.addServlet(context, "session", new SessionServlet());
- context.addServletMappingDecoded("/session", "session");
+ context.addServletMapping("/session", "session");
Wrapper asyncWrapper = Tomcat.addServlet(context, asyncServletName, asyncServlet);
asyncWrapper.setAsyncSupported(true);
- context.addServletMappingDecoded(asyncPath, asyncServletName);
+ context.addServletMapping(asyncPath, asyncServletName);
TesterStore store = new TesterStore();
PersistentValve persistentValve = new PersistentValve();
diff --git a/test/org/apache/catalina/valves/TestProxyErrorReportValve.java b/test/org/apache/catalina/valves/TestProxyErrorReportValve.java
index b4dc29ad7a..268c60b44d 100644
--- a/test/org/apache/catalina/valves/TestProxyErrorReportValve.java
+++ b/test/org/apache/catalina/valves/TestProxyErrorReportValve.java
@@ -51,12 +51,12 @@ public class TestProxyErrorReportValve extends TomcatBaseTest {
Tomcat.addServlet(ctx, "error", new SendErrorServlet(
HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Server broke"));
- ctx.addServletMappingDecoded("/", "error");
+ ctx.addServletMapping("/", "error");
// Register an error page at the Host's error report valve level
// so findErrorPage() returns a URL for the redirect
Tomcat.addServlet(ctx, "errorPage", new ErrorPageServlet());
- ctx.addServletMappingDecoded("/error-page", "errorPage");
+ ctx.addServletMapping("/error-page", "errorPage");
tomcat.start();
@@ -88,10 +88,10 @@ public class TestProxyErrorReportValve extends TomcatBaseTest {
Tomcat.addServlet(ctx, "error", new SendErrorServlet(
HttpServletResponse.SC_NOT_FOUND, "Not found"));
- ctx.addServletMappingDecoded("/", "error");
+ ctx.addServletMapping("/", "error");
Tomcat.addServlet(ctx, "errorPage", new ErrorPageServlet());
- ctx.addServletMappingDecoded("/error-page", "errorPage");
+ ctx.addServletMapping("/error-page", "errorPage");
tomcat.start();
@@ -125,7 +125,7 @@ public class TestProxyErrorReportValve extends TomcatBaseTest {
Tomcat.addServlet(ctx, "error", new SendErrorServlet(
HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "No page configured"));
- ctx.addServletMappingDecoded("/", "error");
+ ctx.addServletMapping("/", "error");
tomcat.start();
@@ -150,7 +150,7 @@ public class TestProxyErrorReportValve extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "hello", new HelloWorldServlet());
- ctx.addServletMappingDecoded("/", "hello");
+ ctx.addServletMapping("/", "hello");
tomcat.start();
@@ -171,7 +171,7 @@ public class TestProxyErrorReportValve extends TomcatBaseTest {
Tomcat.addServlet(ctx, "notFound", new SendErrorServlet(
HttpServletResponse.SC_NOT_FOUND, "Resource not found"));
- ctx.addServletMappingDecoded("/", "notFound");
+ ctx.addServletMapping("/", "notFound");
tomcat.start();
@@ -212,7 +212,7 @@ public class TestProxyErrorReportValve extends TomcatBaseTest {
Tomcat.addServlet(ctx, "error", new SendErrorServlet(
HttpServletResponse.SC_INTERNAL_SERVER_ERROR, customErrorMessage));
- ctx.addServletMappingDecoded("/", "error");
+ ctx.addServletMapping("/", "error");
tomcat.start();
@@ -236,7 +236,7 @@ public class TestProxyErrorReportValve extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "exception", new ExceptionServlet());
- ctx.addServletMappingDecoded("/", "exception");
+ ctx.addServletMapping("/", "exception");
tomcat.start();
@@ -261,10 +261,10 @@ public class TestProxyErrorReportValve extends TomcatBaseTest {
Tomcat.addServlet(ctx, "sendError", new SendErrorServlet(
HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Server broke"));
- ctx.addServletMappingDecoded("/", "sendError");
+ ctx.addServletMapping("/", "sendError");
Tomcat.addServlet(ctx, "errorPage", new ErrorPageServlet());
- ctx.addServletMappingDecoded("/error-page", "errorPage");
+ ctx.addServletMapping("/error-page", "errorPage");
tomcat.start();
@@ -310,7 +310,7 @@ public class TestProxyErrorReportValve extends TomcatBaseTest {
Tomcat.addServlet(ctx, "sendError", new SendErrorServlet(
HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Server broke"));
- ctx.addServletMappingDecoded("/", "sendError");
+ ctx.addServletMapping("/", "sendError");
tomcat.start();
diff --git a/test/org/apache/catalina/valves/TestSemaphoreValve.java b/test/org/apache/catalina/valves/TestSemaphoreValve.java
index 45fad65c3a..d041c7e81d 100644
--- a/test/org/apache/catalina/valves/TestSemaphoreValve.java
+++ b/test/org/apache/catalina/valves/TestSemaphoreValve.java
@@ -48,7 +48,7 @@ public class TestSemaphoreValve extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "hello", new HelloWorldServlet());
- ctx.addServletMappingDecoded("/", "hello");
+ ctx.addServletMapping("/", "hello");
SemaphoreValve valve = new SemaphoreValve();
valve.setConcurrency(10);
@@ -70,7 +70,7 @@ public class TestSemaphoreValve extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "hello", new HelloWorldServlet());
- ctx.addServletMappingDecoded("/", "hello");
+ ctx.addServletMapping("/", "hello");
SemaphoreValve valve = new SemaphoreValve();
valve.setConcurrency(10);
@@ -96,7 +96,7 @@ public class TestSemaphoreValve extends TomcatBaseTest {
CountDownLatch insideServlet = new CountDownLatch(1);
CountDownLatch canReturn = new CountDownLatch(1);
Tomcat.addServlet(ctx, "slow", new SlowServlet(insideServlet, canReturn));
- ctx.addServletMappingDecoded("/", "slow");
+ ctx.addServletMapping("/", "slow");
SemaphoreValve valve = new SemaphoreValve();
valve.setConcurrency(1);
@@ -143,7 +143,7 @@ public class TestSemaphoreValve extends TomcatBaseTest {
CountDownLatch insideServlet = new CountDownLatch(1);
CountDownLatch canReturn = new CountDownLatch(1);
Tomcat.addServlet(ctx, "slow", new SlowServlet(insideServlet, canReturn));
- ctx.addServletMappingDecoded("/", "slow");
+ ctx.addServletMapping("/", "slow");
SemaphoreValve valve = new SemaphoreValve();
valve.setConcurrency(1);
@@ -213,7 +213,7 @@ public class TestSemaphoreValve extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "hello", new HelloWorldServlet());
- ctx.addServletMappingDecoded("/", "hello");
+ ctx.addServletMapping("/", "hello");
SemaphoreValve valve = new SemaphoreValve();
valve.setConcurrency(5);
@@ -242,7 +242,7 @@ public class TestSemaphoreValve extends TomcatBaseTest {
CountDownLatch insideServlet = new CountDownLatch(1);
CountDownLatch canReturn = new CountDownLatch(1);
Tomcat.addServlet(ctx, "slow", new SlowServlet(insideServlet, canReturn));
- ctx.addServletMappingDecoded("/", "slow");
+ ctx.addServletMapping("/", "slow");
SemaphoreValve valve = new SemaphoreValve();
valve.setConcurrency(1);
@@ -299,10 +299,10 @@ public class TestSemaphoreValve extends TomcatBaseTest {
CountDownLatch insideServlet = new CountDownLatch(1);
CountDownLatch canReturn = new CountDownLatch(1);
Tomcat.addServlet(ctx, "slow", new SlowServlet(insideServlet, canReturn));
- ctx.addServletMappingDecoded("/slow", "slow");
+ ctx.addServletMapping("/slow", "slow");
Tomcat.addServlet(ctx, "hello", new HelloWorldServlet());
- ctx.addServletMappingDecoded("/bypass", "hello");
+ ctx.addServletMapping("/bypass", "hello");
SemaphoreValve valve = new SemaphoreValve() {
@Override
diff --git a/test/org/apache/catalina/valves/rewrite/TestRewriteValve.java b/test/org/apache/catalina/valves/rewrite/TestRewriteValve.java
index 324f606edc..bbe289cb41 100644
--- a/test/org/apache/catalina/valves/rewrite/TestRewriteValve.java
+++ b/test/org/apache/catalina/valves/rewrite/TestRewriteValve.java
@@ -909,12 +909,12 @@ public class TestRewriteValve extends TomcatBaseTest {
rewriteValve.setConfiguration(config);
Tomcat.addServlet(ctx, "snoop", new SnoopServlet());
- ctx.addServletMappingDecoded("/a/Z", "snoop");
- ctx.addServletMappingDecoded("/a/%5A", "snoop");
- ctx.addServletMappingDecoded("/c/*", "snoop");
- ctx.addServletMappingDecoded("/W/*", "snoop");
+ ctx.addServletMapping("/a/Z", "snoop");
+ ctx.addServletMapping("/a/%5A", "snoop");
+ ctx.addServletMapping("/c/*", "snoop");
+ ctx.addServletMapping("/W/*", "snoop");
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
@@ -965,8 +965,8 @@ public class TestRewriteValve extends TomcatBaseTest {
rewriteValve.setConfiguration(config);
Tomcat.addServlet(ctx, "tester", new TesterServlet());
- ctx.addServletMappingDecoded("/from/a", "tester");
- ctx.addServletMappingDecoded("/to/b", "tester");
+ ctx.addServletMapping("/from/a", "tester");
+ ctx.addServletMapping("/to/b", "tester");
tomcat.start();
@@ -1007,7 +1007,7 @@ public class TestRewriteValve extends TomcatBaseTest {
Tomcat.addServlet(ctx, "cookieTest", new CookieTestServlet());
- ctx.addServletMappingDecoded("/", "cookieTest");
+ ctx.addServletMapping("/", "cookieTest");
tomcat.start();
@@ -1132,7 +1132,7 @@ public class TestRewriteValve extends TomcatBaseTest {
rewriteValve.setConfiguration("RewriteRule ^/source/(.*)$ /target/$1");
Tomcat.addServlet(ctx, "snoop", new SnoopServlet());
- ctx.addServletMappingDecoded("/target/*", "snoop");
+ ctx.addServletMapping("/target/*", "snoop");
tomcat.start();
@@ -1165,7 +1165,7 @@ public class TestRewriteValve extends TomcatBaseTest {
"RewriteRule ^(.*) /blocked$1 [R]");
Tomcat.addServlet(ctx, "snoop", new SnoopServlet());
- ctx.addServletMappingDecoded("/other", "snoop");
+ ctx.addServletMapping("/other", "snoop");
tomcat.start();
diff --git a/test/org/apache/catalina/webresources/TestWebResourceContentType.java b/test/org/apache/catalina/webresources/TestWebResourceContentType.java
index 1cec7c4624..71590fea3b 100644
--- a/test/org/apache/catalina/webresources/TestWebResourceContentType.java
+++ b/test/org/apache/catalina/webresources/TestWebResourceContentType.java
@@ -55,7 +55,7 @@ public class TestWebResourceContentType extends TomcatBaseTest {
// Add custom default servlet
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/*", "default");
+ ctx.addServletMapping("/*", "default");
tomcat.start();
diff --git a/test/org/apache/coyote/TestAbstractProtocol.java b/test/org/apache/coyote/TestAbstractProtocol.java
index 81367838a6..07f1bd22fe 100644
--- a/test/org/apache/coyote/TestAbstractProtocol.java
+++ b/test/org/apache/coyote/TestAbstractProtocol.java
@@ -69,7 +69,7 @@ public class TestAbstractProtocol extends WebSocketBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/coyote/TestIoTimeouts.java b/test/org/apache/coyote/TestIoTimeouts.java
index 1eb56759dd..becdff01fd 100644
--- a/test/org/apache/coyote/TestIoTimeouts.java
+++ b/test/org/apache/coyote/TestIoTimeouts.java
@@ -93,7 +93,7 @@ public class TestIoTimeouts extends TomcatBaseTest {
Context root = tomcat.addContext("", TEMP_DIR);
Wrapper w = Tomcat.addServlet(root, "Test", new NonBlockingEchoServlet());
w.setAsyncSupported(true);
- root.addServletMappingDecoded("/test", "Test");
+ root.addServletMapping("/test", "Test");
try {
tomcat.start();
diff --git a/test/org/apache/coyote/TestResponse.java b/test/org/apache/coyote/TestResponse.java
index ac68aff0d9..75029e2c93 100644
--- a/test/org/apache/coyote/TestResponse.java
+++ b/test/org/apache/coyote/TestResponse.java
@@ -48,7 +48,7 @@ public class TestResponse extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "CharsetServlet", new CharsetServlet());
- ctx.addServletMappingDecoded("/*", "CharsetServlet");
+ ctx.addServletMapping("/*", "CharsetServlet");
tomcat.start();
@@ -99,7 +99,7 @@ public class TestResponse extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "ContentTypeServlet", new ContentTypeServlet());
- ctx.addServletMappingDecoded("/*", "ContentTypeServlet");
+ ctx.addServletMapping("/*", "ContentTypeServlet");
tomcat.start();
diff --git a/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java b/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java
index 951148ecbb..76d49975d0 100644
--- a/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java
+++ b/test/org/apache/coyote/ajp/TestAbstractAjpProcessor.java
@@ -97,7 +97,7 @@ public class TestAbstractAjpProcessor extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "snoop", new SnoopServlet());
- ctx.addServletMappingDecoded("/", "snoop");
+ ctx.addServletMapping("/", "snoop");
SimpleAjpClient ajpClient = new SimpleAjpClient(ajpPacketSize);
@@ -514,7 +514,7 @@ public class TestAbstractAjpProcessor extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "helloWorld", new HelloWorldServlet());
- ctx.addServletMappingDecoded("/", "helloWorld");
+ ctx.addServletMapping("/", "helloWorld");
StringManager smClient = StringManager.getManager("org.apache.catalina.valves");
String expectedBody = "<p><b>" + smClient.getString("errorReportValve.type") + "</b> " +
@@ -578,7 +578,7 @@ public class TestAbstractAjpProcessor extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "helloWorld", new HelloWorldServlet());
- ctx.addServletMappingDecoded("/", "helloWorld");
+ ctx.addServletMapping("/", "helloWorld");
SimpleAjpClient ajpClient = new SimpleAjpClient();
@@ -685,7 +685,7 @@ public class TestAbstractAjpProcessor extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "bug55453", new Tester304WithBodyServlet());
- ctx.addServletMappingDecoded("/", "bug55453");
+ ctx.addServletMapping("/", "bug55453");
tomcat.start();
@@ -740,7 +740,7 @@ public class TestAbstractAjpProcessor extends TomcatBaseTest {
ReadBodyServlet servlet = new ReadBodyServlet(callAvailable);
Tomcat.addServlet(ctx, "ReadBody", servlet);
- ctx.addServletMappingDecoded("/", "ReadBody");
+ ctx.addServletMapping("/", "ReadBody");
tomcat.start();
@@ -795,7 +795,7 @@ public class TestAbstractAjpProcessor extends TomcatBaseTest {
FixedResponseSizeServlet servlet = new FixedResponseSizeServlet(15000, 16000);
Tomcat.addServlet(ctx, "FixedResponseSizeServlet", servlet);
- ctx.addServletMappingDecoded("/", "FixedResponseSizeServlet");
+ ctx.addServletMapping("/", "FixedResponseSizeServlet");
tomcat.start();
@@ -836,7 +836,7 @@ public class TestAbstractAjpProcessor extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "bug66512", new InvalidHeaderServlet());
- ctx.addServletMappingDecoded("/", "bug66512");
+ ctx.addServletMapping("/", "bug66512");
tomcat.start();
@@ -899,7 +899,7 @@ public class TestAbstractAjpProcessor extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "bug66591", new NoHeadersServlet());
- ctx.addServletMappingDecoded("/", "bug66591");
+ ctx.addServletMapping("/", "bug66591");
tomcat.start();
diff --git a/test/org/apache/coyote/http11/TestHttp11InputBuffer.java b/test/org/apache/coyote/http11/TestHttp11InputBuffer.java
index ddfd153ff7..78ded9a48f 100644
--- a/test/org/apache/coyote/http11/TestHttp11InputBuffer.java
+++ b/test/org/apache/coyote/http11/TestHttp11InputBuffer.java
@@ -67,7 +67,7 @@ public class TestHttp11InputBuffer extends TomcatBaseTest {
Context root = tomcat.addContext("", TEMP_DIR);
Tomcat.addServlet(root, "Bug48839", new Bug48839Servlet());
- root.addServletMappingDecoded("/test", "Bug48839");
+ root.addServletMapping("/test", "Bug48839");
try {
tomcat.start();
@@ -317,7 +317,7 @@ public class TestHttp11InputBuffer extends TomcatBaseTest {
Context root = tomcat.addContext("", TEMP_DIR);
Tomcat.addServlet(root, "Bug51557", new Bug51557Servlet(headerName));
- root.addServletMappingDecoded("/test", "Bug51557");
+ root.addServletMapping("/test", "Bug51557");
try {
Connector connector = tomcat.getConnector();
@@ -452,7 +452,7 @@ public class TestHttp11InputBuffer extends TomcatBaseTest {
Context root = tomcat.addContext("", TEMP_DIR);
Tomcat.addServlet(root, "test", new TesterServlet());
- root.addServletMappingDecoded("/test", "test");
+ root.addServletMapping("/test", "test");
try {
tomcat.start();
@@ -523,7 +523,7 @@ public class TestHttp11InputBuffer extends TomcatBaseTest {
Context root = tomcat.addContext("", TEMP_DIR);
Tomcat.addServlet(root, "Bug54947", new TesterServlet());
- root.addServletMappingDecoded("/test", "Bug54947");
+ root.addServletMapping("/test", "Bug54947");
try {
tomcat.start();
@@ -798,7 +798,7 @@ public class TestHttp11InputBuffer extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "TesterServlet", new TesterServlet());
- ctx.addServletMappingDecoded("/foo", "TesterServlet");
+ ctx.addServletMapping("/foo", "TesterServlet");
tomcat.start();
diff --git a/test/org/apache/coyote/http11/TestHttp11InputBufferCRLF.java b/test/org/apache/coyote/http11/TestHttp11InputBufferCRLF.java
index d87bfa2cfa..aa184886f6 100644
--- a/test/org/apache/coyote/http11/TestHttp11InputBufferCRLF.java
+++ b/test/org/apache/coyote/http11/TestHttp11InputBufferCRLF.java
@@ -181,7 +181,7 @@ public class TestHttp11InputBufferCRLF extends TomcatBaseTest {
Context root = tomcat.addContext("", TEMP_DIR);
Tomcat.addServlet(root, "TesterServlet", new TesterServlet());
- root.addServletMappingDecoded("/test", "TesterServlet");
+ root.addServletMapping("/test", "TesterServlet");
try {
tomcat.start();
diff --git a/test/org/apache/coyote/http11/TestHttp11OutputBuffer.java b/test/org/apache/coyote/http11/TestHttp11OutputBuffer.java
index 82752abf38..d16ec02304 100644
--- a/test/org/apache/coyote/http11/TestHttp11OutputBuffer.java
+++ b/test/org/apache/coyote/http11/TestHttp11OutputBuffer.java
@@ -45,7 +45,7 @@ public class TestHttp11OutputBuffer extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "echo", new EchoBodyServlet());
- ctx.addServletMappingDecoded("/echo", "echo");
+ ctx.addServletMapping("/echo", "echo");
tomcat.start();
@@ -93,7 +93,7 @@ public class TestHttp11OutputBuffer extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "header", new HeaderServlet(customHeaderValue));
- ctx.addServletMappingDecoded("/header", "header");
+ ctx.addServletMapping("/header", "header");
tomcat.start();
diff --git a/test/org/apache/coyote/http11/TestHttp11Processor.java b/test/org/apache/coyote/http11/TestHttp11Processor.java
index 108e96218e..2692d29ec8 100644
--- a/test/org/apache/coyote/http11/TestHttp11Processor.java
+++ b/test/org/apache/coyote/http11/TestHttp11Processor.java
@@ -81,7 +81,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add protected servlet
Tomcat.addServlet(ctx, "ChunkedResponseWithErrorServlet", new ResponseWithErrorServlet(true));
- ctx.addServletMappingDecoded("/*", "ChunkedResponseWithErrorServlet");
+ ctx.addServletMapping("/*", "ChunkedResponseWithErrorServlet");
tomcat.start();
@@ -318,7 +318,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add protected servlet
Tomcat.addServlet(ctx, "TesterServlet", new TesterServlet());
- ctx.addServletMappingDecoded("/foo", "TesterServlet");
+ ctx.addServletMapping("/foo", "TesterServlet");
tomcat.start();
@@ -374,7 +374,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add protected servlet
Wrapper w = Tomcat.addServlet(ctx, "servlet", new Bug64974Servlet());
w.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/foo", "servlet");
+ ctx.addServletMapping("/foo", "servlet");
tomcat.start();
@@ -417,7 +417,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "NoContentLengthFlushingServlet", new NoContentLengthFlushingServlet());
- ctx.addServletMappingDecoded("/test", "NoContentLengthFlushingServlet");
+ ctx.addServletMapping("/test", "NoContentLengthFlushingServlet");
tomcat.start();
@@ -441,7 +441,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
Tomcat.addServlet(ctx, "NoContentLengthConnectionCloseFlushingServlet",
new NoContentLengthConnectionCloseFlushingServlet());
- ctx.addServletMappingDecoded("/test", "NoContentLengthConnectionCloseFlushingServlet");
+ ctx.addServletMapping("/test", "NoContentLengthConnectionCloseFlushingServlet");
tomcat.start();
@@ -476,7 +476,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "LargeHeaderServlet", new LargeHeaderServlet(flush));
- ctx.addServletMappingDecoded("/test", "LargeHeaderServlet");
+ ctx.addServletMapping("/test", "LargeHeaderServlet");
tomcat.start();
@@ -509,7 +509,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "async", new Bug55772Servlet());
- ctx.addServletMappingDecoded("/*", "async");
+ ctx.addServletMapping("/*", "async");
tomcat.start();
@@ -572,10 +572,10 @@ public class TestHttp11Processor extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "echo", new EchoBodyServlet());
- ctx.addServletMappingDecoded("/echo", "echo");
+ ctx.addServletMapping("/echo", "echo");
SecurityCollection collection = new SecurityCollection("All", "");
- collection.addPatternDecoded("/*");
+ collection.addPattern("/*");
SecurityConstraint constraint = new SecurityConstraint();
constraint.addAuthRole("Any");
constraint.addCollection(collection);
@@ -744,7 +744,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
Context root = getProgrammaticRootContext();
Wrapper w = Tomcat.addServlet(root, "Bug57621", new Bug57621Servlet(delayAsyncThread));
w.setAsyncSupported(true);
- root.addServletMappingDecoded("/test", "Bug57621");
+ root.addServletMapping("/test", "Bug57621");
tomcat.start();
@@ -850,7 +850,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "Bug59310", new Bug59310Servlet());
- ctx.addServletMappingDecoded("/test", "Bug59310");
+ ctx.addServletMapping("/test", "Bug59310");
tomcat.start();
@@ -905,7 +905,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
DispatchingServlet servlet = new DispatchingServlet();
Wrapper w = Tomcat.addServlet(ctx, "Test", servlet);
w.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/test", "Test");
+ ctx.addServletMapping("/test", "Test");
tomcat.start();
@@ -993,7 +993,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
Bug61086Servlet servlet = new Bug61086Servlet();
Tomcat.addServlet(ctx, "Test", servlet);
- ctx.addServletMappingDecoded("/test", "Test");
+ ctx.addServletMapping("/test", "Test");
tomcat.start();
@@ -1033,7 +1033,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "TesterServlet", new TesterServlet());
- ctx.addServletMappingDecoded("/foo", "TesterServlet");
+ ctx.addServletMapping("/foo", "TesterServlet");
tomcat.start();
@@ -1071,7 +1071,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "TesterServlet", new TesterServlet());
- ctx.addServletMappingDecoded("/foo", "TesterServlet");
+ ctx.addServletMapping("/foo", "TesterServlet");
tomcat.start();
@@ -1106,7 +1106,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "TesterServlet", new TesterServlet());
- ctx.addServletMappingDecoded("/foo", "TesterServlet");
+ ctx.addServletMapping("/foo", "TesterServlet");
tomcat.start();
@@ -1135,7 +1135,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "TesterServlet", new TesterServlet());
- ctx.addServletMappingDecoded("/foo", "TesterServlet");
+ ctx.addServletMapping("/foo", "TesterServlet");
tomcat.start();
@@ -1169,7 +1169,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "TesterServlet", new TesterServlet());
- ctx.addServletMappingDecoded("/foo", "TesterServlet");
+ ctx.addServletMapping("/foo", "TesterServlet");
tomcat.start();
@@ -1203,7 +1203,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "TesterServlet", new TesterServlet());
- ctx.addServletMappingDecoded("/foo", "TesterServlet");
+ ctx.addServletMapping("/foo", "TesterServlet");
tomcat.start();
@@ -1240,7 +1240,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "TesterServlet", new TesterServlet());
- ctx.addServletMappingDecoded("/foo", "TesterServlet");
+ ctx.addServletMapping("/foo", "TesterServlet");
tomcat.start();
@@ -1277,7 +1277,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "TesterServlet", new TesterServlet());
- ctx.addServletMappingDecoded("/foo", "TesterServlet");
+ ctx.addServletMapping("/foo", "TesterServlet");
tomcat.start();
@@ -1314,7 +1314,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "TesterServlet", new TesterServlet());
- ctx.addServletMappingDecoded("/foo", "TesterServlet");
+ ctx.addServletMapping("/foo", "TesterServlet");
tomcat.start();
@@ -1352,7 +1352,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "TesterServlet", new ServerNameTesterServlet());
- ctx.addServletMappingDecoded("/foo", "TesterServlet");
+ ctx.addServletMapping("/foo", "TesterServlet");
tomcat.start();
@@ -1391,7 +1391,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "TesterServlet", new ServerNameTesterServlet());
- ctx.addServletMappingDecoded("/foo", "TesterServlet");
+ ctx.addServletMapping("/foo", "TesterServlet");
tomcat.start();
@@ -1431,7 +1431,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "TesterServlet", new ServerNameTesterServlet());
- ctx.addServletMappingDecoded("/foo", "TesterServlet");
+ ctx.addServletMapping("/foo", "TesterServlet");
tomcat.start();
@@ -1470,7 +1470,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "TesterServlet", new ServerNameTesterServlet());
- ctx.addServletMappingDecoded("/foo", "TesterServlet");
+ ctx.addServletMapping("/foo", "TesterServlet");
tomcat.start();
@@ -1510,7 +1510,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "TesterServlet", new ServerNameTesterServlet());
- ctx.addServletMappingDecoded("/foo", "TesterServlet");
+ ctx.addServletMapping("/foo", "TesterServlet");
tomcat.start();
@@ -1550,7 +1550,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "TesterServlet", new ServerNameTesterServlet());
- ctx.addServletMappingDecoded("/foo", "TesterServlet");
+ ctx.addServletMapping("/foo", "TesterServlet");
tomcat.start();
@@ -1646,7 +1646,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "TesterServlet", new TesterServlet(explicitClose));
- ctx.addServletMappingDecoded("/foo", "TesterServlet");
+ ctx.addServletMapping("/foo", "TesterServlet");
tomcat.start();
@@ -1762,7 +1762,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "TesterServlet", new SwallowBodyTesterServlet());
- ctx.addServletMappingDecoded("/foo", "TesterServlet");
+ ctx.addServletMapping("/foo", "TesterServlet");
tomcat.start();
@@ -1922,7 +1922,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "TesterServlet", new TesterServlet(false));
- ctx.addServletMappingDecoded("/foo", "TesterServlet");
+ ctx.addServletMapping("/foo", "TesterServlet");
tomcat.start();
@@ -1989,7 +1989,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "TestPostNoReadServlet", new TestPostNoReadServlet());
- ctx.addServletMappingDecoded("/foo", "TestPostNoReadServlet");
+ ctx.addServletMapping("/foo", "TestPostNoReadServlet");
tomcat.start();
@@ -2061,7 +2061,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "EarlyHintsServlet", new EarlyHintsServlet());
- ctx.addServletMappingDecoded("/ehs", "EarlyHintsServlet");
+ ctx.addServletMapping("/ehs", "EarlyHintsServlet");
tomcat.start();
@@ -2093,7 +2093,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "EarlyHintsServlet", new EarlyHintsServlet(true, null));
- ctx.addServletMappingDecoded("/ehs", "EarlyHintsServlet");
+ ctx.addServletMapping("/ehs", "EarlyHintsServlet");
tomcat.start();
@@ -2126,7 +2126,7 @@ public class TestHttp11Processor extends TomcatBaseTest {
// Add servlet
Tomcat.addServlet(ctx, "EarlyHintsServlet", new EarlyHintsServlet(true, "ignored"));
- ctx.addServletMappingDecoded("/ehs", "EarlyHintsServlet");
+ ctx.addServletMapping("/ehs", "EarlyHintsServlet");
tomcat.start();
diff --git a/test/org/apache/coyote/http11/TestHttp11ProcessorDoHead.java b/test/org/apache/coyote/http11/TestHttp11ProcessorDoHead.java
index ef35a867b5..daa3dde728 100644
--- a/test/org/apache/coyote/http11/TestHttp11ProcessorDoHead.java
+++ b/test/org/apache/coyote/http11/TestHttp11ProcessorDoHead.java
@@ -96,7 +96,7 @@ public class TestHttp11ProcessorDoHead extends TomcatBaseTest {
Tomcat.addServlet(ctx, "DoHeadServlet",
new DoHeadServlet(explicitContentLength, contentLength, headSource));
- ctx.addServletMappingDecoded("/head", "DoHeadServlet");
+ ctx.addServletMapping("/head", "DoHeadServlet");
tomcat.start();
diff --git a/test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java b/test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java
index e4017fe2cf..8e79c04d08 100644
--- a/test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java
+++ b/test/org/apache/coyote/http11/filters/TestChunkedInputFilter.java
@@ -114,7 +114,7 @@ public class TestChunkedInputFilter extends TomcatBaseTest {
EchoHeaderServlet servlet = new EchoHeaderServlet(expectPass);
Tomcat.addServlet(ctx, "servlet", servlet);
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
@@ -195,7 +195,7 @@ public class TestChunkedInputFilter extends TomcatBaseTest {
BodyReadServlet servlet = new BodyReadServlet(false, Integer.MAX_VALUE);
Tomcat.addServlet(ctx, "servlet", servlet);
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
@@ -225,7 +225,7 @@ public class TestChunkedInputFilter extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "servlet", new CommitResponseServlet());
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
@@ -290,7 +290,7 @@ public class TestChunkedInputFilter extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "servlet", new EchoHeaderServlet(false));
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
// Limit the size of the trailing header
Assert.assertTrue(tomcat.getConnector().setProperty("maxTrailerSize", Integer.toString(trailerSizeLimit)));
@@ -386,7 +386,7 @@ public class TestChunkedInputFilter extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "servlet", new EchoHeaderServlet(ok));
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
@@ -436,7 +436,7 @@ public class TestChunkedInputFilter extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "servlet", new EchoHeaderServlet(true));
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
@@ -537,7 +537,7 @@ public class TestChunkedInputFilter extends TomcatBaseTest {
BodyReadServlet servlet = new BodyReadServlet(expectPass, readLimit);
Tomcat.addServlet(ctx, "servlet", servlet);
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
@@ -611,7 +611,7 @@ public class TestChunkedInputFilter extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "servlet", new SwallowBodyServlet(swallowException));
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
@@ -816,7 +816,7 @@ public class TestChunkedInputFilter extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "servlet", new SwallowBodyServlet(false));
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
@@ -875,7 +875,7 @@ public class TestChunkedInputFilter extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "servlet", new TesterServlet(false));
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
@@ -1038,7 +1038,7 @@ public class TestChunkedInputFilter extends TomcatBaseTest {
BodyReadLineServlet servlet = new BodyReadLineServlet();
Tomcat.addServlet(ctx, "servlet", servlet);
- ctx.addServletMappingDecoded("/test", "servlet");
+ ctx.addServletMapping("/test", "servlet");
tomcat.getConnector().setProperty("connectionTimeout", "300000");
tomcat.start();
@@ -1092,7 +1092,7 @@ public class TestChunkedInputFilter extends TomcatBaseTest {
NonBlockingReadLineServlet servlet = new NonBlockingReadLineServlet();
Wrapper wrapper = Tomcat.addServlet(ctx, "servlet", servlet);
wrapper.setAsyncSupported(true);
- ctx.addServletMappingDecoded("/test", "servlet");
+ ctx.addServletMapping("/test", "servlet");
tomcat.getConnector().setProperty("connectionTimeout", "300000");
tomcat.start();
@@ -1188,7 +1188,7 @@ public class TestChunkedInputFilter extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "servlet", new EchoHeaderServlet(ok));
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
diff --git a/test/org/apache/coyote/http11/upgrade/TestUpgrade.java b/test/org/apache/coyote/http11/upgrade/TestUpgrade.java
index 63d71528fd..ae46f81013 100644
--- a/test/org/apache/coyote/http11/upgrade/TestUpgrade.java
+++ b/test/org/apache/coyote/http11/upgrade/TestUpgrade.java
@@ -169,7 +169,7 @@ public class TestUpgrade extends TomcatBaseTest {
UpgradeServlet servlet = new UpgradeServlet(upgradeHandlerClass);
Tomcat.addServlet(ctx, "servlet", servlet);
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
diff --git a/test/org/apache/coyote/http11/upgrade/TestUpgradeInternalHandler.java b/test/org/apache/coyote/http11/upgrade/TestUpgradeInternalHandler.java
index 5067d3b625..dec198d083 100644
--- a/test/org/apache/coyote/http11/upgrade/TestUpgradeInternalHandler.java
+++ b/test/org/apache/coyote/http11/upgrade/TestUpgradeInternalHandler.java
@@ -89,7 +89,7 @@ public class TestUpgradeInternalHandler extends TomcatBaseTest {
UpgradeServlet servlet = new UpgradeServlet(upgradeHandlerClass);
Tomcat.addServlet(ctx, "servlet", servlet);
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
tomcat.start();
diff --git a/test/org/apache/coyote/http2/Http2TestBase.java b/test/org/apache/coyote/http2/Http2TestBase.java
index ce5c1d1a5a..fd8186fb9c 100644
--- a/test/org/apache/coyote/http2/Http2TestBase.java
+++ b/test/org/apache/coyote/http2/Http2TestBase.java
@@ -667,15 +667,15 @@ public abstract class Http2TestBase extends TomcatBaseTest {
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "empty", new EmptyServlet());
- ctxt.addServletMappingDecoded("/empty", "empty");
+ ctxt.addServletMapping("/empty", "empty");
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
Tomcat.addServlet(ctxt, "large", new LargeServlet());
- ctxt.addServletMappingDecoded("/large", "large");
+ ctxt.addServletMapping("/large", "large");
Tomcat.addServlet(ctxt, "cookie", new CookieServlet());
- ctxt.addServletMappingDecoded("/cookie", "cookie");
+ ctxt.addServletMapping("/cookie", "cookie");
Tomcat.addServlet(ctxt, "parameter", new ParameterServlet());
- ctxt.addServletMappingDecoded("/parameter", "parameter");
+ ctxt.addServletMapping("/parameter", "parameter");
tomcat.start();
}
diff --git a/test/org/apache/coyote/http2/TestAsync.java b/test/org/apache/coyote/http2/TestAsync.java
index c7bf7b766e..54c780e47d 100644
--- a/test/org/apache/coyote/http2/TestAsync.java
+++ b/test/org/apache/coyote/http2/TestAsync.java
@@ -107,10 +107,10 @@ public class TestAsync extends Http2TestBase {
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
Wrapper w = Tomcat.addServlet(ctxt, "async", new AsyncServlet(blockCount, useNonContainerThreadForWrite));
w.setAsyncSupported(true);
- ctxt.addServletMappingDecoded("/async", "async");
+ ctxt.addServletMapping("/async", "async");
tomcat.start();
int startingWindowSize;
diff --git a/test/org/apache/coyote/http2/TestAsyncError.java b/test/org/apache/coyote/http2/TestAsyncError.java
index 1e1ab6b3d0..e6c35033c1 100644
--- a/test/org/apache/coyote/http2/TestAsyncError.java
+++ b/test/org/apache/coyote/http2/TestAsyncError.java
@@ -53,10 +53,10 @@ public class TestAsyncError extends Http2TestBase {
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
Wrapper w = Tomcat.addServlet(ctxt, "async", asyncErrorServlet);
w.setAsyncSupported(true);
- ctxt.addServletMappingDecoded("/async", "async");
+ ctxt.addServletMapping("/async", "async");
tomcat.start();
openClientConnection();
diff --git a/test/org/apache/coyote/http2/TestAsyncFlush.java b/test/org/apache/coyote/http2/TestAsyncFlush.java
index f7475a02e2..d8875e55f3 100644
--- a/test/org/apache/coyote/http2/TestAsyncFlush.java
+++ b/test/org/apache/coyote/http2/TestAsyncFlush.java
@@ -64,10 +64,10 @@ public class TestAsyncFlush extends Http2TestBase {
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
Wrapper w = Tomcat.addServlet(ctxt, "async", new AsyncFlushServlet(blockCount));
w.setAsyncSupported(true);
- ctxt.addServletMappingDecoded("/async", "async");
+ ctxt.addServletMapping("/async", "async");
tomcat.start();
openClientConnection();
diff --git a/test/org/apache/coyote/http2/TestAsyncReadListener.java b/test/org/apache/coyote/http2/TestAsyncReadListener.java
index 2046b4621f..99a523a311 100644
--- a/test/org/apache/coyote/http2/TestAsyncReadListener.java
+++ b/test/org/apache/coyote/http2/TestAsyncReadListener.java
@@ -96,10 +96,10 @@ public class TestAsyncReadListener extends Http2TestBase {
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
Wrapper w = Tomcat.addServlet(ctxt, "async", asyncServlet);
w.setAsyncSupported(true);
- ctxt.addServletMappingDecoded("/async", "async");
+ ctxt.addServletMapping("/async", "async");
tomcat.start();
}
diff --git a/test/org/apache/coyote/http2/TestAsyncTimeout.java b/test/org/apache/coyote/http2/TestAsyncTimeout.java
index acd3f09549..a27d4f2c38 100644
--- a/test/org/apache/coyote/http2/TestAsyncTimeout.java
+++ b/test/org/apache/coyote/http2/TestAsyncTimeout.java
@@ -48,7 +48,7 @@ public class TestAsyncTimeout extends Http2TestBase {
Context ctxt = getProgrammaticRootContext();
// This is the target of the HTTP/2 upgrade request
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
// This is the servlet that does that actual test
// This latch is used to signal that that async thread used by the test
@@ -57,7 +57,7 @@ public class TestAsyncTimeout extends Http2TestBase {
CountDownLatch latch = new CountDownLatch(1);
Wrapper w = Tomcat.addServlet(ctxt, "async", new AsyncTimeoutServlet(latch));
w.setAsyncSupported(true);
- ctxt.addServletMappingDecoded("/async", "async");
+ ctxt.addServletMapping("/async", "async");
tomcat.start();
openClientConnection();
diff --git a/test/org/apache/coyote/http2/TestCancelledUpload.java b/test/org/apache/coyote/http2/TestCancelledUpload.java
index 72e0b56e4b..b144f7bf13 100644
--- a/test/org/apache/coyote/http2/TestCancelledUpload.java
+++ b/test/org/apache/coyote/http2/TestCancelledUpload.java
@@ -140,7 +140,7 @@ public class TestCancelledUpload extends Http2TestBase {
// Retain '/simple' url-pattern since it enables code re-use
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "cancel", new CancelServlet());
- ctxt.addServletMappingDecoded("/simple", "cancel");
+ ctxt.addServletMapping("/simple", "cancel");
tomcat.start();
}
diff --git a/test/org/apache/coyote/http2/TestHttp2AccessLogs.java b/test/org/apache/coyote/http2/TestHttp2AccessLogs.java
index 6e25345f7e..46201cddc0 100644
--- a/test/org/apache/coyote/http2/TestHttp2AccessLogs.java
+++ b/test/org/apache/coyote/http2/TestHttp2AccessLogs.java
@@ -46,10 +46,10 @@ public class TestHttp2AccessLogs extends Http2TestBase {
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
Wrapper w = Tomcat.addServlet(ctxt, "trailers", new TrailersServlet());
w.setAsyncSupported(true);
- ctxt.addServletMappingDecoded("/trailers", "trailers");
+ ctxt.addServletMapping("/trailers", "trailers");
TesterAccessLogValve valve = new TesterAccessLogValve(writer);
valve.setPattern("%{header-key}o %{trailer-key}o");
tomcat.getHost().getPipeline().addValve(valve);
diff --git a/test/org/apache/coyote/http2/TestHttp2UpgradeHandler.java b/test/org/apache/coyote/http2/TestHttp2UpgradeHandler.java
index c36ef53374..d754e6e721 100644
--- a/test/org/apache/coyote/http2/TestHttp2UpgradeHandler.java
+++ b/test/org/apache/coyote/http2/TestHttp2UpgradeHandler.java
@@ -37,9 +37,9 @@ public class TestHttp2UpgradeHandler extends Http2TestBase {
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
Tomcat.addServlet(ctxt, "large", new LargeHeaderServlet());
- ctxt.addServletMappingDecoded("/large", "large");
+ ctxt.addServletMapping("/large", "large");
tomcat.start();
@@ -145,7 +145,7 @@ public class TestHttp2UpgradeHandler extends Http2TestBase {
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "ReadRequestBodyServlet", new ReadRequestBodyServlet());
- ctxt.addServletMappingDecoded("/", "ReadRequestBodyServlet");
+ ctxt.addServletMapping("/", "ReadRequestBodyServlet");
if (tooBig) {
// Reduce maxSavePostSize rather than use a larger request body
@@ -203,7 +203,7 @@ public class TestHttp2UpgradeHandler extends Http2TestBase {
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
tomcat.start();
diff --git a/test/org/apache/coyote/http2/TestLargeUpload.java b/test/org/apache/coyote/http2/TestLargeUpload.java
index 4b3ee0a7ec..1ea8e26f8e 100644
--- a/test/org/apache/coyote/http2/TestLargeUpload.java
+++ b/test/org/apache/coyote/http2/TestLargeUpload.java
@@ -127,7 +127,7 @@ public class TestLargeUpload extends Http2TestBase {
// Retain '/simple' url-pattern since it enables code re-use
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "read", new DataReadServlet());
- ctxt.addServletMappingDecoded("/simple", "read");
+ ctxt.addServletMapping("/simple", "read");
tomcat.start();
}
diff --git a/test/org/apache/coyote/http2/TestStandardSessionIntegrationHttp2.java b/test/org/apache/coyote/http2/TestStandardSessionIntegrationHttp2.java
index ef6b97d1e1..03f8f8ea28 100644
--- a/test/org/apache/coyote/http2/TestStandardSessionIntegrationHttp2.java
+++ b/test/org/apache/coyote/http2/TestStandardSessionIntegrationHttp2.java
@@ -47,10 +47,10 @@ public class TestStandardSessionIntegrationHttp2 extends Http2TestBase {
Context ctxt = getProgrammaticRootContext();
// Need simple servlet for the HTTP upgrade
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
// Servlet for this test
Tomcat.addServlet(ctxt, "session", new SessionServlet());
- ctxt.addServletMappingDecoded("/session", "session");
+ ctxt.addServletMapping("/session", "session");
tomcat.start();
openClientConnection();
diff --git a/test/org/apache/coyote/http2/TestStream.java b/test/org/apache/coyote/http2/TestStream.java
index 4c0dd16340..4d6de60ab1 100644
--- a/test/org/apache/coyote/http2/TestStream.java
+++ b/test/org/apache/coyote/http2/TestStream.java
@@ -47,9 +47,9 @@ public class TestStream extends Http2TestBase {
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
Tomcat.addServlet(ctxt, "pathparam", new PathParam());
- ctxt.addServletMappingDecoded("/pathparam", "pathparam");
+ ctxt.addServletMapping("/pathparam", "pathparam");
tomcat.start();
@@ -81,9 +81,9 @@ public class TestStream extends Http2TestBase {
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
Tomcat.addServlet(ctxt, "trailers", new ResponseTrailers());
- ctxt.addServletMappingDecoded("/trailers", "trailers");
+ ctxt.addServletMapping("/trailers", "trailers");
tomcat.start();
diff --git a/test/org/apache/coyote/http2/TestStreamProcessor.java b/test/org/apache/coyote/http2/TestStreamProcessor.java
index 67cbb9234b..532096a013 100644
--- a/test/org/apache/coyote/http2/TestStreamProcessor.java
+++ b/test/org/apache/coyote/http2/TestStreamProcessor.java
@@ -55,10 +55,10 @@ public class TestStreamProcessor extends Http2TestBase {
// logic from the super class.
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
Wrapper w = Tomcat.addServlet(ctxt, "async", new AsyncComplete());
w.setAsyncSupported(true);
- ctxt.addServletMappingDecoded("/async", "async");
+ ctxt.addServletMapping("/async", "async");
tomcat.start();
@@ -94,10 +94,10 @@ public class TestStreamProcessor extends Http2TestBase {
// logic from the super class.
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
Wrapper w = Tomcat.addServlet(ctxt, "async", new AsyncDispatch());
w.setAsyncSupported(true);
- ctxt.addServletMappingDecoded("/async", "async");
+ ctxt.addServletMapping("/async", "async");
tomcat.start();
@@ -126,7 +126,7 @@ public class TestStreamProcessor extends Http2TestBase {
Context ctxt = tomcat.addWebapp(null, "", appDir.getAbsolutePath());
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
tomcat.start();
@@ -178,9 +178,9 @@ public class TestStreamProcessor extends Http2TestBase {
Context ctxt = tomcat.addWebapp(null, "", appDir.getAbsolutePath());
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
Tomcat.addServlet(ctxt, "noContent", new NoContentServlet());
- ctxt.addServletMappingDecoded("/noContent", "noContent");
+ ctxt.addServletMapping("/noContent", "noContent");
tomcat.start();
@@ -226,7 +226,7 @@ public class TestStreamProcessor extends Http2TestBase {
Context ctxt = tomcat.addWebapp(null, "", appDir.getAbsolutePath());
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
tomcat.start();
@@ -270,7 +270,7 @@ public class TestStreamProcessor extends Http2TestBase {
Context ctxt = tomcat.addWebapp(null, "", appDir.getAbsolutePath());
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
tomcat.start();
@@ -312,7 +312,7 @@ public class TestStreamProcessor extends Http2TestBase {
Context ctxt = tomcat.addWebapp(null, "", appDir.getAbsolutePath());
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
tomcat.start();
@@ -356,7 +356,7 @@ public class TestStreamProcessor extends Http2TestBase {
Context ctxt = tomcat.addWebapp(null, "", appDir.getAbsolutePath());
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
tomcat.start();
@@ -400,7 +400,7 @@ public class TestStreamProcessor extends Http2TestBase {
Context ctxt = tomcat.addWebapp(null, "", appDir.getAbsolutePath());
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
tomcat.getConnector().setProperty("relaxedQueryChars", "[]");
@@ -501,9 +501,9 @@ public class TestStreamProcessor extends Http2TestBase {
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
Tomcat.addServlet(ctxt, "compression", new CompressionServlet());
- ctxt.addServletMappingDecoded("/compression", "compression");
+ ctxt.addServletMapping("/compression", "compression");
// Enable compression
Connector connector = tomcat.getConnector();
@@ -599,9 +599,9 @@ public class TestStreamProcessor extends Http2TestBase {
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
Tomcat.addServlet(ctxt, "ehs", new EarlyHintsServlet());
- ctxt.addServletMappingDecoded("/ehs", "ehs");
+ ctxt.addServletMapping("/ehs", "ehs");
tomcat.start();
openClientConnection();
@@ -664,9 +664,9 @@ public class TestStreamProcessor extends Http2TestBase {
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
Tomcat.addServlet(ctxt, "server", new ServerHeaderServlet());
- ctxt.addServletMappingDecoded("/server", "server");
+ ctxt.addServletMapping("/server", "server");
tomcat.start();
openClientConnection();
@@ -707,9 +707,9 @@ public class TestStreamProcessor extends Http2TestBase {
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
Tomcat.addServlet(ctxt, "server", new ServerHeaderServlet());
- ctxt.addServletMappingDecoded("/server", "server");
+ ctxt.addServletMapping("/server", "server");
tomcat.start();
openClientConnection();
@@ -747,9 +747,9 @@ public class TestStreamProcessor extends Http2TestBase {
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "simple", new SimpleServlet());
- ctxt.addServletMappingDecoded("/simple", "simple");
+ ctxt.addServletMapping("/simple", "simple");
Tomcat.addServlet(ctxt, "server", new ServerHeaderServlet());
- ctxt.addServletMappingDecoded("/server", "server");
+ ctxt.addServletMapping("/server", "server");
tomcat.start();
openClientConnection();
diff --git a/test/org/apache/coyote/http2/TestStreamQueryString.java b/test/org/apache/coyote/http2/TestStreamQueryString.java
index 899508085c..1333ab7ee6 100644
--- a/test/org/apache/coyote/http2/TestStreamQueryString.java
+++ b/test/org/apache/coyote/http2/TestStreamQueryString.java
@@ -76,7 +76,7 @@ public class TestStreamQueryString extends Http2TestBase {
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "query", new Query(queryValue));
- ctxt.addServletMappingDecoded("/query", "query");
+ ctxt.addServletMapping("/query", "query");
tomcat.start();
diff --git a/test/org/apache/jasper/runtime/TestPageContextImpl.java b/test/org/apache/jasper/runtime/TestPageContextImpl.java
index 7f67009630..def4b63a1b 100644
--- a/test/org/apache/jasper/runtime/TestPageContextImpl.java
+++ b/test/org/apache/jasper/runtime/TestPageContextImpl.java
@@ -64,7 +64,7 @@ public class TestPageContextImpl extends TomcatBaseTest {
// Add the Servlet
Tomcat.addServlet(ctx, "bug56010", new Bug56010());
- ctx.addServletMappingDecoded("/bug56010", "bug56010");
+ ctx.addServletMapping("/bug56010", "bug56010");
tomcat.start();
diff --git a/test/org/apache/jasper/servlet/TestJspServlet.java b/test/org/apache/jasper/servlet/TestJspServlet.java
index a904c23c24..fd0b0b1ba2 100644
--- a/test/org/apache/jasper/servlet/TestJspServlet.java
+++ b/test/org/apache/jasper/servlet/TestJspServlet.java
@@ -47,7 +47,7 @@ public class TestJspServlet extends TomcatBaseTest {
// Create a servlet that always throws an exception for a PUT request
Tomcat.addServlet(context, "Bug56568Servlet", new Bug56568aServlet());
- context.addServletMappingDecoded("/bug56568", "Bug56568Servlet");
+ context.addServletMapping("/bug56568", "Bug56568Servlet");
// Configure a JSP page to handle the 500 error response
// The JSP page will see the same method as the original request (PUT)
diff --git a/test/org/apache/juli/TestPerWebappJuliIntegration.java b/test/org/apache/juli/TestPerWebappJuliIntegration.java
index 2a6d0deee4..a32d1f8014 100644
--- a/test/org/apache/juli/TestPerWebappJuliIntegration.java
+++ b/test/org/apache/juli/TestPerWebappJuliIntegration.java
@@ -109,7 +109,7 @@ public class TestPerWebappJuliIntegration extends TomcatBaseTest {
resp.getWriter().print(Logger.getLogger("").getLevel());
}
});
- context.addServletMappingDecoded("/log_level", "log_level");
+ context.addServletMapping("/log_level", "log_level");
}
private ConstructAppResult constructAppForHandlerIsolationTest(Tomcat tomcat, String appId, Level logLevel) throws FileNotFoundException {
File appDir = new File(getTemporaryDirectory(), "juliHandler" + appId);
@@ -138,7 +138,7 @@ public class TestPerWebappJuliIntegration extends TomcatBaseTest {
root.info("JULI-" + appId + "-INFO");
}
});
- context.addServletMappingDecoded("/test", "test");
+ context.addServletMapping("/test", "test");
return new ConstructAppResult(logsDir, context);
}
private static class ConstructAppResult {
diff --git a/test/org/apache/naming/TestEnvEntry.java b/test/org/apache/naming/TestEnvEntry.java
index 6eebd1fba6..7efd9c89da 100644
--- a/test/org/apache/naming/TestEnvEntry.java
+++ b/test/org/apache/naming/TestEnvEntry.java
@@ -118,7 +118,7 @@ public class TestEnvEntry extends TomcatBaseTest {
Context context = tomcat.addWebapp(null, "/test", appDir.getAbsolutePath());
Tomcat.addServlet(context, "InjectionServlet", "org.apache.naming.TesterInjectionServlet");
- context.addServletMappingDecoded("/injection", "InjectionServlet");
+ context.addServletMapping("/injection", "InjectionServlet");
tomcat.enableNaming();
tomcat.start();
diff --git a/test/org/apache/naming/resources/TestNamingContext.java b/test/org/apache/naming/resources/TestNamingContext.java
index 1bd78fc8ca..99ed7d3cb6 100644
--- a/test/org/apache/naming/resources/TestNamingContext.java
+++ b/test/org/apache/naming/resources/TestNamingContext.java
@@ -71,7 +71,7 @@ public class TestNamingContext extends TomcatBaseTest {
// Map the test Servlet
Bug49994Servlet bug49994Servlet = new Bug49994Servlet();
Tomcat.addServlet(ctx, "bug49994Servlet", bug49994Servlet);
- ctx.addServletMappingDecoded("/", "bug49994Servlet");
+ ctx.addServletMapping("/", "bug49994Servlet");
tomcat.start();
@@ -131,7 +131,7 @@ public class TestNamingContext extends TomcatBaseTest {
// Map the test Servlet
Bug23950Servlet bug23950Servlet = new Bug23950Servlet();
Tomcat.addServlet(ctx, "bug23950Servlet", bug23950Servlet);
- ctx.addServletMappingDecoded("/", "bug23950Servlet");
+ ctx.addServletMapping("/", "bug23950Servlet");
tomcat.start();
@@ -183,7 +183,7 @@ public class TestNamingContext extends TomcatBaseTest {
// Map the test Servlet
Bug50351Servlet bug50351Servlet = new Bug50351Servlet();
Tomcat.addServlet(ctx, "bug50351Servlet", bug50351Servlet);
- ctx.addServletMappingDecoded("/", "bug50351Servlet");
+ ctx.addServletMapping("/", "bug50351Servlet");
tomcat.start();
@@ -236,7 +236,7 @@ public class TestNamingContext extends TomcatBaseTest {
// Map the test Servlet
Bug51744Servlet bug51744Servlet = new Bug51744Servlet();
Tomcat.addServlet(ctx, "bug51744Servlet", bug51744Servlet);
- ctx.addServletMappingDecoded("/", "bug51744Servlet");
+ ctx.addServletMapping("/", "bug51744Servlet");
tomcat.start();
@@ -299,7 +299,7 @@ public class TestNamingContext extends TomcatBaseTest {
// Map the test Servlet
Bug52830Servlet bug52830Servlet = new Bug52830Servlet();
Tomcat.addServlet(ctx, "bug52830Servlet", bug52830Servlet);
- ctx.addServletMappingDecoded("/", "bug52830Servlet");
+ ctx.addServletMapping("/", "bug52830Servlet");
tomcat.start();
diff --git a/test/org/apache/tomcat/integration/httpd/HttpdIntegrationBaseTest.java b/test/org/apache/tomcat/integration/httpd/HttpdIntegrationBaseTest.java
index 90f190f32d..1468022c92 100644
--- a/test/org/apache/tomcat/integration/httpd/HttpdIntegrationBaseTest.java
+++ b/test/org/apache/tomcat/integration/httpd/HttpdIntegrationBaseTest.java
@@ -118,7 +118,7 @@ public abstract class HttpdIntegrationBaseTest extends TomcatBaseTest {
ctx.getPipeline().addValve(valve);
}
Tomcat.addServlet(ctx, SERVLET_NAME, new SnoopServlet());
- ctx.addServletMappingDecoded("/" + SERVLET_NAME, SERVLET_NAME);
+ ctx.addServletMapping("/" + SERVLET_NAME, SERVLET_NAME);
tomcat.start();
tomcatPort = getPort();
}
diff --git a/test/org/apache/tomcat/integration/httpd/TestErrorHandling.java b/test/org/apache/tomcat/integration/httpd/TestErrorHandling.java
index ef5c23f625..57e9932c88 100644
--- a/test/org/apache/tomcat/integration/httpd/TestErrorHandling.java
+++ b/test/org/apache/tomcat/integration/httpd/TestErrorHandling.java
@@ -71,7 +71,7 @@ public class TestErrorHandling extends HttpdIntegrationBaseTest {
throw new ServletException("Expected error");
}
});
- ctx.addServletMappingDecoded("/error", "error");
+ ctx.addServletMapping("/error", "error");
int rc = getUrl("http://localhost:" + getHttpdPort() + "/error", new ByteChunk(), false);
Assert.assertEquals(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, rc);
}
diff --git a/test/org/apache/tomcat/security/TestSecurity2017Ocsp.java b/test/org/apache/tomcat/security/TestSecurity2017Ocsp.java
index 8b2625f100..91485c22f1 100644
--- a/test/org/apache/tomcat/security/TestSecurity2017Ocsp.java
+++ b/test/org/apache/tomcat/security/TestSecurity2017Ocsp.java
@@ -80,7 +80,7 @@ public class TestSecurity2017Ocsp extends OcspBaseTest {
Context ctx = tomcat.addContext("", null);
Tomcat.addServlet(ctx, "simple", new SimpleServlet());
- ctx.addServletMappingDecoded("/simple", "simple");
+ ctx.addServletMapping("/simple", "simple");
// Use the default (valid, non-revoked) server certificate
TesterSupport.initSsl(tomcat, useOpenSSLTrust);
diff --git a/test/org/apache/tomcat/security/TestSecurity2018.java b/test/org/apache/tomcat/security/TestSecurity2018.java
index f970bc5fbd..c906cc4e9f 100644
--- a/test/org/apache/tomcat/security/TestSecurity2018.java
+++ b/test/org/apache/tomcat/security/TestSecurity2018.java
@@ -53,7 +53,7 @@ public class TestSecurity2018 extends WebSocketBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/tomcat/security/TestSecurity2019.java b/test/org/apache/tomcat/security/TestSecurity2019.java
index 5e3da2634d..407a30468b 100644
--- a/test/org/apache/tomcat/security/TestSecurity2019.java
+++ b/test/org/apache/tomcat/security/TestSecurity2019.java
@@ -57,7 +57,7 @@ public class TestSecurity2019 extends TomcatBaseTest {
Context ctx = tomcat.addContext("", appDir.getAbsolutePath());
Tomcat.addServlet(ctx, "ssi", new SSIServlet());
- ctx.addServletMappingDecoded("*.shtml", "ssi");
+ ctx.addServletMapping("*.shtml", "ssi");
ctx.setPrivileged(true);
@@ -92,11 +92,11 @@ public class TestSecurity2019 extends TomcatBaseTest {
FilterMap filterMap = new FilterMap();
filterMap.setFilterName("ssi");
- filterMap.addURLPatternDecoded("*.shtml");
+ filterMap.addURLPattern("*.shtml");
ctx.addFilterMap(filterMap);
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
ctx.addMimeMapping("shtml", "text/x-server-parsed-html");
ctx.setPrivileged(true);
@@ -164,7 +164,7 @@ public class TestSecurity2019 extends TomcatBaseTest {
cgi.addInitParameter("cgiPathPrefix", "WEB-INF/cgi");
cgi.addInitParameter("executable", "");
cgi.addInitParameter("enableCmdLineArguments", "true");
- ctx.addServletMappingDecoded("/cgi/*", "cgi");
+ ctx.addServletMapping("/cgi/*", "cgi");
tomcat.start();
diff --git a/test/org/apache/tomcat/security/TestSecurity2023.java b/test/org/apache/tomcat/security/TestSecurity2023.java
index 012966e227..268187f5c2 100644
--- a/test/org/apache/tomcat/security/TestSecurity2023.java
+++ b/test/org/apache/tomcat/security/TestSecurity2023.java
@@ -75,7 +75,7 @@ public class TestSecurity2023 extends TomcatBaseTest {
Context context = tomcat.addContext("", null);
Wrapper wrapper = Tomcat.addServlet(context, "test", new TestServlet());
wrapper.setMultipartConfigElement(new MultipartConfigElement(""));
- context.addServletMappingDecoded("/", "test");
+ context.addServletMapping("/", "test");
FilterDef filterDef = new FilterDef();
filterDef.setFilterName("FailedRequestFilter");
@@ -133,11 +133,11 @@ public class TestSecurity2023 extends TomcatBaseTest {
tomcat.addRole("admin", "admin");
Tomcat.addServlet(context, "login", new TestServlet());
- context.addServletMappingDecoded("/login", "login");
+ context.addServletMapping("/login", "login");
Tomcat.addServlet(context, "secret", new TestServlet());
- context.addServletMappingDecoded("/secret.html", "secret");
+ context.addServletMapping("/secret.html", "secret");
Tomcat.addServlet(context, "example", new TestServlet());
- context.addServletMappingDecoded("/example.com", "example");
+ context.addServletMapping("/example.com", "example");
tomcat.start();
diff --git a/test/org/apache/tomcat/unittest/TesterContext.java b/test/org/apache/tomcat/unittest/TesterContext.java
index d24ebf5184..736001dfad 100644
--- a/test/org/apache/tomcat/unittest/TesterContext.java
+++ b/test/org/apache/tomcat/unittest/TesterContext.java
@@ -772,6 +772,13 @@ public class TesterContext implements Context {
}
@Override
+ public void addServletMapping(String pattern, String name,
+ boolean jspWildcard) {
+ // NO-OP
+ }
+
+ @Override
+ @Deprecated
public void addServletMappingDecoded(String pattern, String name,
boolean jspWildcard) {
// NO-OP
diff --git a/test/org/apache/tomcat/util/descriptor/web/TestJspPropertyGroupDescriptorImpl.java b/test/org/apache/tomcat/util/descriptor/web/TestJspPropertyGroupDescriptorImpl.java
index 15ce498a8e..4266ed8896 100644
--- a/test/org/apache/tomcat/util/descriptor/web/TestJspPropertyGroupDescriptorImpl.java
+++ b/test/org/apache/tomcat/util/descriptor/web/TestJspPropertyGroupDescriptorImpl.java
@@ -42,7 +42,7 @@ public class TestJspPropertyGroupDescriptorImpl {
@Test
public void testUrlPatternsAreIsolated() {
JspPropertyGroup jpg = new JspPropertyGroup();
- jpg.addUrlPatternDecoded("pattern");
+ jpg.addUrlPattern("pattern");
JspPropertyGroupDescriptorImpl descriptor = new JspPropertyGroupDescriptorImpl(jpg);
descriptor.getUrlPatterns().clear();
Assert.assertEquals(1, descriptor.getUrlPatterns().size());
diff --git a/test/org/apache/tomcat/util/descriptor/web/TestSecurityConstraint.java b/test/org/apache/tomcat/util/descriptor/web/TestSecurityConstraint.java
index 36f53e190d..5a9d91a75f 100644
--- a/test/org/apache/tomcat/util/descriptor/web/TestSecurityConstraint.java
+++ b/test/org/apache/tomcat/util/descriptor/web/TestSecurityConstraint.java
@@ -52,7 +52,7 @@ public class TestSecurityConstraint {
GET_ONLY.addAuthRole(ROLE1);
SecurityCollection scGetOnly = new SecurityCollection();
scGetOnly.addMethod(Method.GET);
- scGetOnly.addPatternDecoded(URL_PATTERN);
+ scGetOnly.addPattern(URL_PATTERN);
scGetOnly.setName("GET-ONLY");
GET_ONLY.addCollection(scGetOnly);
@@ -60,7 +60,7 @@ public class TestSecurityConstraint {
POST_ONLY.addAuthRole(ROLE1);
SecurityCollection scPostOnly = new SecurityCollection();
scPostOnly.addMethod(Method.POST);
- scPostOnly.addPatternDecoded(URL_PATTERN);
+ scPostOnly.addPattern(URL_PATTERN);
scPostOnly.setName("POST_ONLY");
POST_ONLY.addCollection(scPostOnly);
@@ -68,7 +68,7 @@ public class TestSecurityConstraint {
GET_OMIT.addAuthRole(ROLE1);
SecurityCollection scGetOmit = new SecurityCollection();
scGetOmit.addOmittedMethod(Method.GET);
- scGetOmit.addPatternDecoded(URL_PATTERN);
+ scGetOmit.addPattern(URL_PATTERN);
scGetOmit.setName("GET_OMIT");
GET_OMIT.addCollection(scGetOmit);
@@ -76,7 +76,7 @@ public class TestSecurityConstraint {
POST_OMIT.addAuthRole(ROLE1);
SecurityCollection scPostOmit = new SecurityCollection();
scPostOmit.addOmittedMethod(Method.POST);
- scPostOmit.addPatternDecoded(URL_PATTERN);
+ scPostOmit.addPattern(URL_PATTERN);
scPostOmit.setName("POST_OMIT");
POST_OMIT.addCollection(scPostOmit);
}
diff --git a/test/org/apache/tomcat/util/descriptor/web/TestWebXml.java b/test/org/apache/tomcat/util/descriptor/web/TestWebXml.java
index 01ec9c7489..43778239c1 100644
--- a/test/org/apache/tomcat/util/descriptor/web/TestWebXml.java
+++ b/test/org/apache/tomcat/util/descriptor/web/TestWebXml.java
@@ -249,7 +249,7 @@ public class TestWebXml {
FilterMap filterMap = new FilterMap();
filterMap.setFilterName("Dummy");
- filterMap.addURLPatternDecoded("/*");
+ filterMap.addURLPattern("/*");
webXmlDefaultFragment.addFilterMapping(filterMap);
// Listeners were added in 2.3 so should be excluded in 2.2
@@ -294,7 +294,7 @@ public class TestWebXml {
sc.setDisplayName("dummy");
SecurityCollection collection = new SecurityCollection();
collection.setName("dummy");
- collection.addPatternDecoded("/*");
+ collection.addPattern("/*");
collection.addMethod(Method.DELETE);
sc.addCollection(collection);
webXmlDefaultFragment.addSecurityConstraint(sc);
@@ -491,6 +491,7 @@ public class TestWebXml {
}
+ @SuppressWarnings("deprecation")
@Test
public void testEncoding() {
WebXml webXml = new WebXml();
diff --git a/test/org/apache/tomcat/util/http/TestCookieParsing.java b/test/org/apache/tomcat/util/http/TestCookieParsing.java
index 27589bd9ad..ad261d30b7 100644
--- a/test/org/apache/tomcat/util/http/TestCookieParsing.java
+++ b/test/org/apache/tomcat/util/http/TestCookieParsing.java
@@ -292,7 +292,7 @@ public class TestCookieParsing extends TomcatBaseTest {
} else {
Tomcat.addServlet(root, "Cookies", new EchoCookies());
}
- root.addServletMappingDecoded("/test", "Cookies");
+ root.addServletMapping("/test", "Cookies");
tomcat.start();
// Open connection
diff --git a/test/org/apache/tomcat/util/http/TestCookieProcessorGenerationHttp.java b/test/org/apache/tomcat/util/http/TestCookieProcessorGenerationHttp.java
index d16cb84150..17a7861a35 100644
--- a/test/org/apache/tomcat/util/http/TestCookieProcessorGenerationHttp.java
+++ b/test/org/apache/tomcat/util/http/TestCookieProcessorGenerationHttp.java
@@ -47,7 +47,7 @@ public class TestCookieProcessorGenerationHttp extends TomcatBaseTest {
Map<String,String> cookies = new HashMap<>();
cookies.put("Test", "\u0120");
Tomcat.addServlet(ctx, "test", new CookieServlet(cookies));
- ctx.addServletMappingDecoded("/test", "test");
+ ctx.addServletMapping("/test", "test");
tomcat.start();
Map<String,List<String>> headers = new HashMap<>();
@@ -99,7 +99,7 @@ public class TestCookieProcessorGenerationHttp extends TomcatBaseTest {
cookies.put("aaa", "zzz");
cookies.put("aAa", "yyy");
Tomcat.addServlet(ctx, "test", new CookieServlet(cookies));
- ctx.addServletMappingDecoded("/test", "test");
+ ctx.addServletMapping("/test", "test");
tomcat.start();
Map<String,List<String>> headers = new HashMap<>();
diff --git a/test/org/apache/tomcat/util/http/TestMimeHeadersIntegration.java b/test/org/apache/tomcat/util/http/TestMimeHeadersIntegration.java
index 3de4950661..a780aff4fc 100644
--- a/test/org/apache/tomcat/util/http/TestMimeHeadersIntegration.java
+++ b/test/org/apache/tomcat/util/http/TestMimeHeadersIntegration.java
@@ -53,7 +53,7 @@ public class TestMimeHeadersIntegration extends TomcatBaseTest {
res.getWriter().write("OK");
}
});
- ctx.addServletMappingDecoded("/", "servlet");
+ ctx.addServletMapping("/", "servlet");
alv = new HeaderCountLogValve();
tomcat.getHost().getPipeline().addValve(alv);
diff --git a/test/org/apache/tomcat/util/net/TestAlpnFallback.java b/test/org/apache/tomcat/util/net/TestAlpnFallback.java
index 45f6fbf7a2..ad162547c8 100644
--- a/test/org/apache/tomcat/util/net/TestAlpnFallback.java
+++ b/test/org/apache/tomcat/util/net/TestAlpnFallback.java
@@ -37,7 +37,7 @@ public class TestAlpnFallback extends Http2TestBase {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "snoop", new SnoopServlet());
- ctx.addServletMappingDecoded("/", "snoop");
+ ctx.addServletMapping("/", "snoop");
tomcat.start();
diff --git a/test/org/apache/tomcat/util/net/TestLargeClientHello.java b/test/org/apache/tomcat/util/net/TestLargeClientHello.java
index 21ca1919f4..3e48de8cb9 100644
--- a/test/org/apache/tomcat/util/net/TestLargeClientHello.java
+++ b/test/org/apache/tomcat/util/net/TestLargeClientHello.java
@@ -62,7 +62,7 @@ public class TestLargeClientHello extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "hello", new HelloWorldServlet());
- ctx.addServletMappingDecoded("/", "hello");
+ ctx.addServletMapping("/", "hello");
TesterSupport.initSsl(tomcat, credential.getKeystore().getAbsolutePath(),
credential.getCertificate().getAbsolutePath(), credential.getKey().getAbsolutePath(), false);
diff --git a/test/org/apache/tomcat/util/net/TestPQC.java b/test/org/apache/tomcat/util/net/TestPQC.java
index f99c869abb..22e849fe00 100644
--- a/test/org/apache/tomcat/util/net/TestPQC.java
+++ b/test/org/apache/tomcat/util/net/TestPQC.java
@@ -96,7 +96,7 @@ public class TestPQC extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "TesterServlet", new TesterServlet());
- ctx.addServletMappingDecoded("/*", "TesterServlet");
+ ctx.addServletMapping("/*", "TesterServlet");
}
@Test
diff --git a/test/org/apache/tomcat/util/net/TestSSLHostConfigCipher.java b/test/org/apache/tomcat/util/net/TestSSLHostConfigCipher.java
index 75c8e90d00..90a5ee6e21 100644
--- a/test/org/apache/tomcat/util/net/TestSSLHostConfigCipher.java
+++ b/test/org/apache/tomcat/util/net/TestSSLHostConfigCipher.java
@@ -87,7 +87,7 @@ public class TestSSLHostConfigCipher extends TomcatBaseTest {
// Simple webapp
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "TesterServlet", new TesterServlet());
- ctxt.addServletMappingDecoded("/*", "TesterServlet");
+ ctxt.addServletMapping("/*", "TesterServlet");
}
diff --git a/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java b/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java
index e43fde7f9a..2cc93af88f 100644
--- a/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java
+++ b/test/org/apache/tomcat/util/net/TestSSLHostConfigCompat.java
@@ -323,7 +323,7 @@ public class TestSSLHostConfigCompat extends TomcatBaseTest {
// Simple webapp
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "TesterServlet", new TesterServlet());
- ctxt.addServletMappingDecoded("/*", "TesterServlet");
+ ctxt.addServletMapping("/*", "TesterServlet");
}
diff --git a/test/org/apache/tomcat/util/net/TestSSLHostConfigProtocol.java b/test/org/apache/tomcat/util/net/TestSSLHostConfigProtocol.java
index 05b14dfef3..2dc73a21c3 100644
--- a/test/org/apache/tomcat/util/net/TestSSLHostConfigProtocol.java
+++ b/test/org/apache/tomcat/util/net/TestSSLHostConfigProtocol.java
@@ -108,7 +108,7 @@ public class TestSSLHostConfigProtocol extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "hello", new HelloWorldServlet());
- ctx.addServletMappingDecoded("/", "hello");
+ ctx.addServletMapping("/", "hello");
Tomcat tomcat = getTomcatInstance();
tomcat.start();
@@ -129,7 +129,7 @@ public class TestSSLHostConfigProtocol extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "hello", new HelloWorldServlet());
- ctx.addServletMappingDecoded("/", "hello");
+ ctx.addServletMapping("/", "hello");
Tomcat tomcat = getTomcatInstance();
tomcat.start();
diff --git a/test/org/apache/tomcat/util/net/TestSsl.java b/test/org/apache/tomcat/util/net/TestSsl.java
index d4aabb0327..ce656bb8de 100644
--- a/test/org/apache/tomcat/util/net/TestSsl.java
+++ b/test/org/apache/tomcat/util/net/TestSsl.java
@@ -149,7 +149,7 @@ public class TestSsl extends TomcatBaseTest {
ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "post", new SimplePostServlet());
- ctxt.addServletMappingDecoded("/post", "post");
+ ctxt.addServletMapping("/post", "post");
TesterSupport.initSsl(tomcat);
TesterSupport.configureSSLImplementation(tomcat, sslImplementationName, useOpenSSL);
@@ -182,7 +182,7 @@ public class TestSsl extends TomcatBaseTest {
Context ctxt = getProgrammaticRootContext();
Tomcat.addServlet(ctxt, "post", new SimplePostServlet());
- ctxt.addServletMappingDecoded("/post", "post");
+ ctxt.addServletMapping("/post", "post");
tomcat.start();
int iterations = 8;
CountDownLatch latch = new CountDownLatch(iterations);
@@ -461,7 +461,7 @@ public class TestSsl extends TomcatBaseTest {
Context root = tomcat.addContext("", TEMP_DIR);
Wrapper w = Tomcat.addServlet(root, "tester", new TesterServlet());
w.setAsyncSupported(true);
- root.addServletMappingDecoded("/", "tester");
+ root.addServletMapping("/", "tester");
tomcat.start();
diff --git a/test/org/apache/tomcat/util/net/TestSslHandshakeFailure.java b/test/org/apache/tomcat/util/net/TestSslHandshakeFailure.java
index f271e3dc7e..f12924d291 100644
--- a/test/org/apache/tomcat/util/net/TestSslHandshakeFailure.java
+++ b/test/org/apache/tomcat/util/net/TestSslHandshakeFailure.java
@@ -67,7 +67,7 @@ public class TestSslHandshakeFailure extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
Tomcat.addServlet(ctx, "hello", new HelloWorldServlet());
- ctx.addServletMappingDecoded("/", "hello");
+ ctx.addServletMapping("/", "hello");
TesterSupport.initSsl(tomcat);
TesterSupport.configureSSLImplementation(tomcat, sslImplementationName, useOpenSSL);
diff --git a/test/org/apache/tomcat/util/net/TesterSupport.java b/test/org/apache/tomcat/util/net/TesterSupport.java
index ec3373b957..2e774e224c 100644
--- a/test/org/apache/tomcat/util/net/TesterSupport.java
+++ b/test/org/apache/tomcat/util/net/TesterSupport.java
@@ -355,12 +355,12 @@ public final class TesterSupport {
Context ctx = tomcat.addContext("", null);
Tomcat.addServlet(ctx, "simple", new SimpleServlet());
- ctx.addServletMappingDecoded("/unprotected", "simple");
- ctx.addServletMappingDecoded("/protected", "simple");
+ ctx.addServletMapping("/unprotected", "simple");
+ ctx.addServletMapping("/protected", "simple");
// Security constraints
SecurityCollection collection = new SecurityCollection();
- collection.addPatternDecoded("/protected");
+ collection.addPattern("/protected");
SecurityConstraint sc = new SecurityConstraint();
sc.addAuthRole(ROLE);
sc.addCollection(collection);
diff --git a/test/org/apache/tomcat/util/net/ocsp/OcspBaseTest.java b/test/org/apache/tomcat/util/net/ocsp/OcspBaseTest.java
index e84ebd41ef..750c550389 100644
--- a/test/org/apache/tomcat/util/net/ocsp/OcspBaseTest.java
+++ b/test/org/apache/tomcat/util/net/ocsp/OcspBaseTest.java
@@ -120,7 +120,7 @@ public class OcspBaseTest extends TomcatBaseTest {
Context ctx = tomcat.addContext("", null);
Tomcat.addServlet(ctx, "simple", new SimpleServlet());
- ctx.addServletMappingDecoded("/simple", "simple");
+ ctx.addServletMapping("/simple", "simple");
if (serverCertValid) {
TesterSupport.initSsl(tomcat, useOpenSSLTrust);
diff --git a/test/org/apache/tomcat/util/net/ocsp/TesterOcspResponder.java b/test/org/apache/tomcat/util/net/ocsp/TesterOcspResponder.java
index 2902109cc9..67a10b5197 100644
--- a/test/org/apache/tomcat/util/net/ocsp/TesterOcspResponder.java
+++ b/test/org/apache/tomcat/util/net/ocsp/TesterOcspResponder.java
@@ -73,7 +73,7 @@ public class TesterOcspResponder {
// No file system docBase required
Context ctx = ocspResponder.addContext("", null);
Wrapper w = Tomcat.addServlet(ctx, "responder", new TesterOcspResponderServlet());
- ctx.addServletMappingDecoded("/", "responder");
+ ctx.addServletMapping("/", "responder");
if (fixedResponse != null) {
w.addInitParameter(TesterOcspResponderServlet.INIT_FIXED_RESPONSE, fixedResponse.toString());
}
diff --git a/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java b/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java
index 6af2a4c052..50282f9dbf 100644
--- a/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java
+++ b/test/org/apache/tomcat/websocket/TestWebSocketFrameClient.java
@@ -57,7 +57,7 @@ public class TestWebSocketFrameClient extends WebSocketBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterFirehoseServer.ConfigInline.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
@@ -97,11 +97,11 @@ public class TestWebSocketFrameClient extends WebSocketBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
Context ctx2 = tomcat.addContext("/foo", null);
ctx2.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx2, "default", new DefaultServlet());
- ctx2.addServletMappingDecoded("/", "default");
+ ctx2.addServletMapping("/", "default");
tomcat.start();
@@ -147,10 +147,10 @@ public class TestWebSocketFrameClient extends WebSocketBaseTest {
Context ctx = tomcat.addContext(URI_PROTECTED, null);
ctx.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
SecurityCollection collection = new SecurityCollection();
- collection.addPatternDecoded("/");
+ collection.addPattern("/");
String utf8User = "test";
String utf8Pass = "123\u00A3"; // pound sign
@@ -185,10 +185,10 @@ public class TestWebSocketFrameClient extends WebSocketBaseTest {
Context ctx = tomcat.addContext(URI_PROTECTED, null);
ctx.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
SecurityCollection collection = new SecurityCollection();
- collection.addPatternDecoded("/*");
+ collection.addPattern("/*");
tomcat.addUser(USER, PWD);
tomcat.addRole(USER, ROLE);
diff --git a/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java b/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java
index 1378638b9b..aee57d65d4 100644
--- a/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java
+++ b/test/org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java
@@ -78,7 +78,7 @@ public class TestWebSocketFrameClientSSL extends WebSocketBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterFirehoseServer.ConfigInline.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
@@ -116,7 +116,7 @@ public class TestWebSocketFrameClientSSL extends WebSocketBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterFirehoseServer.ConfigInline.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/tomcat/websocket/TestWsPingPongMessages.java b/test/org/apache/tomcat/websocket/TestWsPingPongMessages.java
index 83f6af9928..7a59e9ffdd 100644
--- a/test/org/apache/tomcat/websocket/TestWsPingPongMessages.java
+++ b/test/org/apache/tomcat/websocket/TestWsPingPongMessages.java
@@ -50,7 +50,7 @@ public class TestWsPingPongMessages extends WebSocketBaseTest {
ctx.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/tomcat/websocket/TestWsRemoteEndpoint.java b/test/org/apache/tomcat/websocket/TestWsRemoteEndpoint.java
index 21a3d8a1ef..3ce01689c0 100644
--- a/test/org/apache/tomcat/websocket/TestWsRemoteEndpoint.java
+++ b/test/org/apache/tomcat/websocket/TestWsRemoteEndpoint.java
@@ -95,7 +95,7 @@ public class TestWsRemoteEndpoint extends WebSocketBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
WebSocketContainer wsContainer = ContainerProvider.getWebSocketContainer();
@@ -202,7 +202,7 @@ public class TestWsRemoteEndpoint extends WebSocketBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
WebSocketContainer wsContainer = ContainerProvider.getWebSocketContainer();
diff --git a/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java b/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java
index 9b345d27e7..fa93fe042e 100644
--- a/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java
+++ b/test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java
@@ -55,7 +55,7 @@ public class TestWsSessionSuspendResume extends WebSocketBaseTest {
ctx.addApplicationListener(SuspendResumeConfig.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
@@ -156,7 +156,7 @@ public class TestWsSessionSuspendResume extends WebSocketBaseTest {
ctx.addApplicationListener(WebSocketFastServerTimeout.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/tomcat/websocket/TestWsSubprotocols.java b/test/org/apache/tomcat/websocket/TestWsSubprotocols.java
index 55e05a9b35..b8877a82de 100644
--- a/test/org/apache/tomcat/websocket/TestWsSubprotocols.java
+++ b/test/org/apache/tomcat/websocket/TestWsSubprotocols.java
@@ -49,7 +49,7 @@ public class TestWsSubprotocols extends WebSocketBaseTest {
ctx.addApplicationListener(Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java b/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java
index 91caf2b61d..1b57ce8fb3 100644
--- a/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java
+++ b/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java
@@ -78,7 +78,7 @@ public class TestWsWebSocketContainer extends WsWebSocketContainerBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
@@ -192,7 +192,7 @@ public class TestWsWebSocketContainer extends WsWebSocketContainerBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
WebSocketContainer wsContainer = ContainerProvider.getWebSocketContainer();
@@ -366,7 +366,7 @@ public class TestWsWebSocketContainer extends WsWebSocketContainerBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
@@ -416,7 +416,7 @@ public class TestWsWebSocketContainer extends WsWebSocketContainerBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
@@ -456,7 +456,7 @@ public class TestWsWebSocketContainer extends WsWebSocketContainerBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
@@ -554,7 +554,7 @@ public class TestWsWebSocketContainer extends WsWebSocketContainerBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
@@ -636,7 +636,7 @@ public class TestWsWebSocketContainer extends WsWebSocketContainerBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerGetOpenSessions.java b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerGetOpenSessions.java
index c7adee6cc6..5df6406af6 100644
--- a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerGetOpenSessions.java
+++ b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerGetOpenSessions.java
@@ -172,7 +172,7 @@ public class TestWsWebSocketContainerGetOpenSessions extends WebSocketBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerSSL.java b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerSSL.java
index 090c6496ce..b71f718000 100644
--- a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerSSL.java
+++ b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerSSL.java
@@ -77,7 +77,7 @@ public class TestWsWebSocketContainerSSL extends WebSocketBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerSessionExpiryContainerClient.java b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerSessionExpiryContainerClient.java
index aad99b46f7..91241ef760 100644
--- a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerSessionExpiryContainerClient.java
+++ b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerSessionExpiryContainerClient.java
@@ -45,7 +45,7 @@ public class TestWsWebSocketContainerSessionExpiryContainerClient extends WsWebS
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerSessionExpiryContainerServer.java b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerSessionExpiryContainerServer.java
index c9651ed46b..ea6cca2cc5 100644
--- a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerSessionExpiryContainerServer.java
+++ b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerSessionExpiryContainerServer.java
@@ -49,7 +49,7 @@ public class TestWsWebSocketContainerSessionExpiryContainerServer extends WsWebS
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
ctx.addApplicationListener(WebSocketServerTimeoutConfig.class.getName());
diff --git a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerSessionExpirySession.java b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerSessionExpirySession.java
index 29c04943d8..63d98481b8 100644
--- a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerSessionExpirySession.java
+++ b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerSessionExpirySession.java
@@ -45,7 +45,7 @@ public class TestWsWebSocketContainerSessionExpirySession extends WsWebSocketCon
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutClient.java b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutClient.java
index bc039e2423..14dd5261c3 100644
--- a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutClient.java
+++ b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutClient.java
@@ -62,7 +62,7 @@ public class TestWsWebSocketContainerTimeoutClient extends WsWebSocketContainerB
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(BlockingConfig.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
WebSocketContainer wsContainer = ContainerProvider.getWebSocketContainer();
diff --git a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java
index 8d414fe33d..8af3b69fa6 100644
--- a/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java
+++ b/test/org/apache/tomcat/websocket/TestWsWebSocketContainerTimeoutServer.java
@@ -79,7 +79,7 @@ public class TestWsWebSocketContainerTimeoutServer extends WsWebSocketContainerB
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(ConstantTxConfig.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
WebSocketContainer wsContainer = ContainerProvider.getWebSocketContainer();
diff --git a/test/org/apache/tomcat/websocket/TesterConnectionLimitPerformance.java b/test/org/apache/tomcat/websocket/TesterConnectionLimitPerformance.java
index 4d2a801e51..5ce7d0555d 100644
--- a/test/org/apache/tomcat/websocket/TesterConnectionLimitPerformance.java
+++ b/test/org/apache/tomcat/websocket/TesterConnectionLimitPerformance.java
@@ -49,7 +49,7 @@ public class TesterConnectionLimitPerformance extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
Assert.assertTrue(tomcat.getConnector().setProperty("maxConnections", "-1"));
diff --git a/test/org/apache/tomcat/websocket/TesterWebSocketClientProxy.java b/test/org/apache/tomcat/websocket/TesterWebSocketClientProxy.java
index 3e7b4f1e4e..bed7cc9f4f 100644
--- a/test/org/apache/tomcat/websocket/TesterWebSocketClientProxy.java
+++ b/test/org/apache/tomcat/websocket/TesterWebSocketClientProxy.java
@@ -162,7 +162,7 @@ public class TesterWebSocketClientProxy extends WebSocketBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterEchoServer.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
if (serverAuthentication) {
// Configure Realm
@@ -171,7 +171,7 @@ public class TesterWebSocketClientProxy extends WebSocketBaseTest {
// Configure security constraints
SecurityCollection securityCollection = new SecurityCollection();
- securityCollection.addPatternDecoded("/*");
+ securityCollection.addPattern("/*");
SecurityConstraint securityConstraint = new SecurityConstraint();
securityConstraint.addAuthRole(TOMCAT_ROLE);
securityConstraint.addCollection(securityCollection);
diff --git a/test/org/apache/tomcat/websocket/WebSocketBaseTest.java b/test/org/apache/tomcat/websocket/WebSocketBaseTest.java
index 5e714ab1ec..e509f5ab29 100644
--- a/test/org/apache/tomcat/websocket/WebSocketBaseTest.java
+++ b/test/org/apache/tomcat/websocket/WebSocketBaseTest.java
@@ -35,7 +35,7 @@ public abstract class WebSocketBaseTest extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(configClass.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
return tomcat;
diff --git a/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java b/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java
index c714cf6265..f036626a33 100644
--- a/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java
+++ b/test/org/apache/tomcat/websocket/pojo/TestEncodingDecoding.java
@@ -80,7 +80,7 @@ public class TestEncodingDecoding extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(ProgrammaticServerEndpointConfig.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
WebSocketContainer wsContainer = ContainerProvider.getWebSocketContainer();
@@ -126,7 +126,7 @@ public class TestEncodingDecoding extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(ServerConfigListener.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
WebSocketContainer wsContainer = ContainerProvider.getWebSocketContainer();
@@ -183,7 +183,7 @@ public class TestEncodingDecoding extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(ServerConfigListener.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
WebSocketContainer wsContainer = ContainerProvider.getWebSocketContainer();
@@ -231,7 +231,7 @@ public class TestEncodingDecoding extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(ServerConfigListener.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
WebSocketContainer wsContainer = ContainerProvider.getWebSocketContainer();
@@ -277,7 +277,7 @@ public class TestEncodingDecoding extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(ServerConfigListener.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
WebSocketContainer wsContainer = ContainerProvider.getWebSocketContainer();
@@ -763,7 +763,7 @@ public class TestEncodingDecoding extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(ProgrammaticServerEndpointConfig.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
WebSocketContainer wsContainer = ContainerProvider.getWebSocketContainer();
diff --git a/test/org/apache/tomcat/websocket/pojo/TestPojoEndpointBase.java b/test/org/apache/tomcat/websocket/pojo/TestPojoEndpointBase.java
index 436cd1e529..3fbc19ecb4 100644
--- a/test/org/apache/tomcat/websocket/pojo/TestPojoEndpointBase.java
+++ b/test/org/apache/tomcat/websocket/pojo/TestPojoEndpointBase.java
@@ -56,7 +56,7 @@ public class TestPojoEndpointBase extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(ServerConfigListener.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
WebSocketContainer wsContainer = ContainerProvider.getWebSocketContainer();
@@ -86,7 +86,7 @@ public class TestPojoEndpointBase extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(ServerConfigListener.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
WebSocketContainer wsContainer = ContainerProvider.getWebSocketContainer();
diff --git a/test/org/apache/tomcat/websocket/pojo/TestPojoMethodMapping.java b/test/org/apache/tomcat/websocket/pojo/TestPojoMethodMapping.java
index 6b8667d952..431ddc2925 100644
--- a/test/org/apache/tomcat/websocket/pojo/TestPojoMethodMapping.java
+++ b/test/org/apache/tomcat/websocket/pojo/TestPojoMethodMapping.java
@@ -59,7 +59,7 @@ public class TestPojoMethodMapping extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(ServerConfigListener.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
WebSocketContainer wsContainer = ContainerProvider.getWebSocketContainer();
diff --git a/test/org/apache/tomcat/websocket/server/TestAsyncMessagesPerformance.java b/test/org/apache/tomcat/websocket/server/TestAsyncMessagesPerformance.java
index 764c1e4e9a..ec875377ff 100644
--- a/test/org/apache/tomcat/websocket/server/TestAsyncMessagesPerformance.java
+++ b/test/org/apache/tomcat/websocket/server/TestAsyncMessagesPerformance.java
@@ -51,7 +51,7 @@ public class TestAsyncMessagesPerformance extends TomcatBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(TesterAsyncTiming.Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/tomcat/websocket/server/TestClassLoader.java b/test/org/apache/tomcat/websocket/server/TestClassLoader.java
index c99ebf9cb4..13cc5564bb 100644
--- a/test/org/apache/tomcat/websocket/server/TestClassLoader.java
+++ b/test/org/apache/tomcat/websocket/server/TestClassLoader.java
@@ -57,7 +57,7 @@ public class TestClassLoader extends WebSocketBaseTest {
ctx.addApplicationListener(Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/tomcat/websocket/server/TestCloseBug58624.java b/test/org/apache/tomcat/websocket/server/TestCloseBug58624.java
index d1e775feb3..11a5a224e7 100644
--- a/test/org/apache/tomcat/websocket/server/TestCloseBug58624.java
+++ b/test/org/apache/tomcat/websocket/server/TestCloseBug58624.java
@@ -50,7 +50,7 @@ public class TestCloseBug58624 extends WebSocketBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(Bug58624ServerConfig.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
WebSocketContainer wsContainer = ContainerProvider.getWebSocketContainer();
diff --git a/test/org/apache/tomcat/websocket/server/TestShutdown.java b/test/org/apache/tomcat/websocket/server/TestShutdown.java
index fee640b46f..ae60f38ba8 100644
--- a/test/org/apache/tomcat/websocket/server/TestShutdown.java
+++ b/test/org/apache/tomcat/websocket/server/TestShutdown.java
@@ -54,7 +54,7 @@ public class TestShutdown extends WebSocketBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(EchoBufferedConfig.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/tomcat/websocket/server/TestSlowClient.java b/test/org/apache/tomcat/websocket/server/TestSlowClient.java
index 7f65243c1d..47e2e37d31 100644
--- a/test/org/apache/tomcat/websocket/server/TestSlowClient.java
+++ b/test/org/apache/tomcat/websocket/server/TestSlowClient.java
@@ -48,7 +48,7 @@ public class TestSlowClient extends WebSocketBaseTest {
// in response to any message received.
ctx.addApplicationListener(TesterFirehoseServer.ConfigThread.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
diff --git a/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java b/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java
index 1068bc005e..215bb370d8 100644
--- a/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java
+++ b/test/org/apache/tomcat/websocket/server/TestWsRemoteEndpointImplServerDeadlock.java
@@ -108,7 +108,7 @@ public class TestWsRemoteEndpointImplServerDeadlock extends WebSocketBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(Bug66508Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
WebSocketContainer wsContainer = ContainerProvider.getWebSocketContainer();
diff --git a/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java b/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java
index 3965c6e4b9..46182d2d1e 100644
--- a/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java
+++ b/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java
@@ -65,7 +65,7 @@ public class TestWsServerContainer extends WebSocketBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(Bug54807Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
tomcat.start();
@@ -80,7 +80,7 @@ public class TestWsServerContainer extends WebSocketBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(Bug54807Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
WebSocketContainer wsContainer = ContainerProvider.getWebSocketContainer();
diff --git a/test/org/apache/tomcat/websocket/server/TesterWsRemoteEndpointImplServer.java b/test/org/apache/tomcat/websocket/server/TesterWsRemoteEndpointImplServer.java
index de349f9c92..d08f39c409 100644
--- a/test/org/apache/tomcat/websocket/server/TesterWsRemoteEndpointImplServer.java
+++ b/test/org/apache/tomcat/websocket/server/TesterWsRemoteEndpointImplServer.java
@@ -69,7 +69,7 @@ public class TesterWsRemoteEndpointImplServer extends WebSocketBaseTest {
Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(Bug58624Config.class.getName());
Tomcat.addServlet(ctx, "default", new DefaultServlet());
- ctx.addServletMappingDecoded("/", "default");
+ ctx.addServletMapping("/", "default");
WebSocketContainer wsContainer = ContainerProvider.getWebSocketContainer();
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index aa56d61316..ac3babad90 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -175,6 +175,20 @@
of particular not for attributes that implement
<code>HttpSessionBindingListener</code>. (markt)
</fix>
+ <fix>
+ Add a new attribute to the <code>Context</code>,
+ <code>urlPatternsProvidedInDecodedForm</code>. This attribute controls
+ whether URLs and URL patterns provided in the deployment descriptor
+ (web.xml), annotations and/or their programmatic equivalents are treated
+ as being provided in URL-encoded form (i.e. using %nn encoding) or in
+ decoded form. The Servlet specification requires that they are provided
+ in decoded form. However, Tomcat has historically treated them as if
+ they are provided in encoded form. In Tomcat 12, they will always be
+ treated as if they are provided in decoded form. This setting enables
+ migration from encoded form to decoded form on an application by
+ application basis. This attribute will be removed in Tomcat 12 where it
+ will effectively be hard-coded to <code>true</code>. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
diff --git a/webapps/docs/config/context.xml b/webapps/docs/config/context.xml
index d315787871..dd4f8e7505 100644
--- a/webapps/docs/config/context.xml
+++ b/webapps/docs/config/context.xml
@@ -662,6 +662,22 @@
penalty.</p>
</attribute>
+ <attribute name="urlPatternsProvidedInDecodedForm" required="false">
+ <p>This attribute controls whether URLs and URL patterns provided in
+ the deployment descriptor (web.xml), annotations and/or their
+ programmatic equivalents are treated as being provided in URL-encoded
+ form (i.e. using %nn encoding) or in decoded form. The Servlet
+ specification requires that they are provided in decoded form. However,
+ Tomcat has historically treated them as if they are provided in encoded
+ form. In Tomcat 12, they will always be treated as if they are provided
+ in decoded form. This setting enables migration from encoded form to
+ decoded form on an application by application basis.</p>
+ <p>If not specified, the default value of <code>false</code> will be
+ used.</p>
+ <p>This attribute will be removed in Tomcat 12 where it will effectively
+ be hard-coded to <code>true</code>.</p>
+ </attribute>
+
<attribute name="useBloomFilterForArchives" required="false">
<p>DEPRECATED: If this is <code>true</code> then a bloom filter will be
used to speed up archive lookups. This can be beneficial to the deployment
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.