Author: markt Date: Tue May 23 13:53:57 2017 New Revision: 1795915 URL: http://svn.apache.org/viewvc?rev=1795915&view=rev Log: Servlet 4.0 Rename ServletMapping -> HttpServletMapping
Added: tomcat/trunk/java/javax/servlet/http/HttpServletMapping.java - copied, changed from r1795914, tomcat/trunk/java/javax/servlet/http/ServletMapping.java Removed: tomcat/trunk/java/javax/servlet/http/ServletMapping.java Modified: tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java tomcat/trunk/java/org/apache/catalina/connector/Request.java tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java tomcat/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java tomcat/trunk/java/org/apache/catalina/core/ApplicationMapping.java tomcat/trunk/test/org/apache/catalina/core/TestApplicationMapping.java tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServletRequest.java Copied: tomcat/trunk/java/javax/servlet/http/HttpServletMapping.java (from r1795914, tomcat/trunk/java/javax/servlet/http/ServletMapping.java) URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpServletMapping.java?p2=tomcat/trunk/java/javax/servlet/http/HttpServletMapping.java&p1=tomcat/trunk/java/javax/servlet/http/ServletMapping.java&r1=1795914&r2=1795915&rev=1795915&view=diff ============================================================================== --- tomcat/trunk/java/javax/servlet/http/ServletMapping.java (original) +++ tomcat/trunk/java/javax/servlet/http/HttpServletMapping.java Tue May 23 13:53:57 2017 @@ -24,7 +24,7 @@ import javax.servlet.annotation.WebServl * * @since 4.0 */ -public interface ServletMapping { +public interface HttpServletMapping { /** * @return The value that was matched or the empty String if not known. Modified: tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java?rev=1795915&r1=1795914&r2=1795915&view=diff ============================================================================== --- tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java (original) +++ tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java Tue May 23 13:53:57 2017 @@ -172,8 +172,8 @@ public interface HttpServletRequest exte */ public int getIntHeader(String name); - public default ServletMapping getServletMapping() { - return new ServletMapping() { + public default HttpServletMapping getHttpServletMapping() { + return new HttpServletMapping() { @Override public String getMatchValue() { Modified: tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java?rev=1795915&r1=1795914&r2=1795915&view=diff ============================================================================== --- tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java (original) +++ tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java Tue May 23 13:53:57 2017 @@ -120,8 +120,8 @@ public class HttpServletRequestWrapper e * wrapped request object. */ @Override - public ServletMapping getServletMapping() { - return this._getHttpServletRequest().getServletMapping(); + public HttpServletMapping getHttpServletMapping() { + return this._getHttpServletRequest().getHttpServletMapping(); } /** Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=1795915&r1=1795914&r2=1795915&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Tue May 23 13:53:57 2017 @@ -58,6 +58,7 @@ import javax.servlet.ServletRequestAttri import javax.servlet.ServletResponse; import javax.servlet.SessionTrackingMode; import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletMapping; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import javax.servlet.http.HttpServletResponse; @@ -65,7 +66,6 @@ import javax.servlet.http.HttpSession; import javax.servlet.http.HttpUpgradeHandler; import javax.servlet.http.Part; import javax.servlet.http.PushBuilder; -import javax.servlet.http.ServletMapping; import org.apache.catalina.Container; import org.apache.catalina.Context; @@ -2243,8 +2243,8 @@ public class Request implements HttpServ @Override - public ServletMapping getServletMapping() { - return applicationMapping.getServletMapping(); + public HttpServletMapping getHttpServletMapping() { + return applicationMapping.getHttpServletMapping(); } Modified: tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java?rev=1795915&r1=1795914&r2=1795915&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java Tue May 23 13:53:57 2017 @@ -34,13 +34,13 @@ import javax.servlet.ServletInputStream; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletMapping; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpUpgradeHandler; import javax.servlet.http.Part; import javax.servlet.http.PushBuilder; -import javax.servlet.http.ServletMapping; import org.apache.catalina.Globals; import org.apache.catalina.security.SecurityUtil; @@ -738,14 +738,14 @@ public class RequestFacade implements Ht @Override - public ServletMapping getServletMapping() { + public HttpServletMapping getHttpServletMapping() { if (request == null) { throw new IllegalStateException( sm.getString("requestFacade.nullRequest")); } - return request.getServletMapping(); + return request.getHttpServletMapping(); } Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java?rev=1795915&r1=1795914&r2=1795915&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java Tue May 23 13:53:57 2017 @@ -52,10 +52,10 @@ import javax.servlet.ServletRequestListe import javax.servlet.SessionCookieConfig; import javax.servlet.SessionTrackingMode; import javax.servlet.descriptor.JspConfigDescriptor; +import javax.servlet.http.HttpServletMapping; import javax.servlet.http.HttpSessionAttributeListener; import javax.servlet.http.HttpSessionIdListener; import javax.servlet.http.HttpSessionListener; -import javax.servlet.http.ServletMapping; import org.apache.catalina.Container; import org.apache.catalina.Context; @@ -482,7 +482,7 @@ public class ApplicationContext implemen Wrapper wrapper = mappingData.wrapper; String wrapperPath = mappingData.wrapperPath.toString(); String pathInfo = mappingData.pathInfo.toString(); - ServletMapping mapping = new ApplicationMapping(mappingData).getServletMapping(); + HttpServletMapping mapping = new ApplicationMapping(mappingData).getHttpServletMapping(); mappingData.recycle(); Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java?rev=1795915&r1=1795914&r2=1795915&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java Tue May 23 13:53:57 2017 @@ -33,9 +33,9 @@ import javax.servlet.ServletRequestWrapp import javax.servlet.ServletResponse; import javax.servlet.ServletResponseWrapper; import javax.servlet.UnavailableException; +import javax.servlet.http.HttpServletMapping; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.ServletMapping; import org.apache.catalina.AsyncDispatcher; import org.apache.catalina.Context; @@ -207,7 +207,7 @@ final class ApplicationDispatcher implem */ public ApplicationDispatcher (Wrapper wrapper, String requestURI, String servletPath, - String pathInfo, String queryString, ServletMapping mapping, String name) { + String pathInfo, String queryString, HttpServletMapping mapping, String name) { super(); @@ -264,7 +264,7 @@ final class ApplicationDispatcher implem /** * The mapping for this RequestDispatcher. */ - private final ServletMapping mapping; + private final HttpServletMapping mapping; /** @@ -368,7 +368,7 @@ final class ApplicationDispatcher implem hrequest.getPathInfo()); wrequest.setAttribute(RequestDispatcher.FORWARD_QUERY_STRING, hrequest.getQueryString()); - wrequest.setAttribute(RequestDispatcher.FORWARD_MAPPING, hrequest.getServletMapping()); + wrequest.setAttribute(RequestDispatcher.FORWARD_MAPPING, hrequest.getHttpServletMapping()); } wrequest.setContextPath(context.getPath()); @@ -616,7 +616,7 @@ final class ApplicationDispatcher implem wrequest.setAttribute(Globals.DISPATCHER_TYPE_ATTR, DispatcherType.ASYNC); wrequest.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR, getCombinedPath()); - wrequest.setAttribute(AsyncContext.ASYNC_MAPPING, hrequest.getServletMapping()); + wrequest.setAttribute(AsyncContext.ASYNC_MAPPING, hrequest.getHttpServletMapping()); wrequest.setContextPath(context.getPath()); wrequest.setRequestURI(requestURI); Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java?rev=1795915&r1=1795914&r2=1795915&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java Tue May 23 13:53:57 2017 @@ -33,11 +33,11 @@ import java.util.NoSuchElementException; import javax.servlet.DispatcherType; import javax.servlet.RequestDispatcher; import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletMapping; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import javax.servlet.http.HttpSession; import javax.servlet.http.PushBuilder; -import javax.servlet.http.ServletMapping; import org.apache.catalina.Context; import org.apache.catalina.Globals; @@ -193,7 +193,7 @@ class ApplicationHttpRequest extends Htt /** * The mapping for this request. */ - private ServletMapping mapping = null; + private HttpServletMapping mapping = null; /** @@ -492,7 +492,7 @@ class ApplicationHttpRequest extends Htt @Override - public ServletMapping getServletMapping() { + public HttpServletMapping getHttpServletMapping() { return mapping; } @@ -676,7 +676,7 @@ class ApplicationHttpRequest extends Htt queryString = request.getQueryString(); requestURI = request.getRequestURI(); servletPath = request.getServletPath(); - mapping = request.getServletMapping(); + mapping = request.getHttpServletMapping(); } @@ -735,7 +735,7 @@ class ApplicationHttpRequest extends Htt } - void setMapping(ServletMapping mapping) { + void setMapping(HttpServletMapping mapping) { this.mapping = mapping; } Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationMapping.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationMapping.java?rev=1795915&r1=1795914&r2=1795915&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/ApplicationMapping.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/ApplicationMapping.java Tue May 23 13:53:57 2017 @@ -16,8 +16,8 @@ */ package org.apache.catalina.core; +import javax.servlet.http.HttpServletMapping; import javax.servlet.http.MappingMatch; -import javax.servlet.http.ServletMapping; import org.apache.catalina.mapper.MappingData; @@ -25,13 +25,13 @@ public class ApplicationMapping { private final MappingData mappingData; - private volatile ServletMapping mapping = null; + private volatile HttpServletMapping mapping = null; public ApplicationMapping(MappingData mappingData) { this.mappingData = mappingData; } - public ServletMapping getServletMapping() { + public HttpServletMapping getHttpServletMapping() { if (mapping == null) { String servletName; if (mappingData.wrapper == null) { @@ -79,7 +79,7 @@ public class ApplicationMapping { mapping = null; } - private static class MappingImpl implements ServletMapping { + private static class MappingImpl implements HttpServletMapping { private final String matchValue; private final String pattern; Modified: tomcat/trunk/test/org/apache/catalina/core/TestApplicationMapping.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestApplicationMapping.java?rev=1795915&r1=1795914&r2=1795915&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/catalina/core/TestApplicationMapping.java (original) +++ tomcat/trunk/test/org/apache/catalina/core/TestApplicationMapping.java Tue May 23 13:53:57 2017 @@ -23,9 +23,9 @@ import javax.servlet.AsyncContext; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletMapping; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.ServletMapping; import org.junit.Assert; import org.junit.Test; @@ -340,13 +340,13 @@ public class TestApplicationMapping exte throws ServletException, IOException { resp.setContentType("text/plain;charset=UTF-8"); PrintWriter pw = resp.getWriter(); - ServletMapping mapping = req.getServletMapping(); + HttpServletMapping mapping = req.getHttpServletMapping(); pw.println("MatchValue=[" + mapping.getMatchValue() + "]"); pw.println("Pattern=[" + mapping.getPattern() + "]"); pw.println("MatchType=[" + mapping.getMappingMatch() + "]"); pw.println("ServletName=[" + mapping.getServletName() + "]"); - ServletMapping includeMapping = - (ServletMapping) req.getAttribute(RequestDispatcher.INCLUDE_MAPPING); + HttpServletMapping includeMapping = + (HttpServletMapping) req.getAttribute(RequestDispatcher.INCLUDE_MAPPING); if (includeMapping != null) { pw.println("IncludeMatchValue=[" + includeMapping.getMatchValue() + "]"); pw.println("IncludePattern=[" + includeMapping.getPattern() + "]"); @@ -354,16 +354,16 @@ public class TestApplicationMapping exte pw.println("IncludeServletName=[" + includeMapping.getServletName() + "]"); } - ServletMapping forwardMapping = - (ServletMapping) req.getAttribute(RequestDispatcher.FORWARD_MAPPING); + HttpServletMapping forwardMapping = + (HttpServletMapping) req.getAttribute(RequestDispatcher.FORWARD_MAPPING); if (forwardMapping != null) { pw.println("ForwardMatchValue=[" + forwardMapping.getMatchValue() + "]"); pw.println("ForwardPattern=[" + forwardMapping.getPattern() + "]"); pw.println("ForwardMatchType=[" + forwardMapping.getMappingMatch() + "]"); pw.println("ForwardServletName=[" + forwardMapping.getServletName() + "]"); } - ServletMapping asyncMapping = - (ServletMapping) req.getAttribute(AsyncContext.ASYNC_MAPPING); + HttpServletMapping asyncMapping = + (HttpServletMapping) req.getAttribute(AsyncContext.ASYNC_MAPPING); if (asyncMapping != null) { pw.println("AsyncMatchValue=[" + asyncMapping.getMatchValue() + "]"); pw.println("AsyncPattern=[" + asyncMapping.getPattern() + "]"); Modified: tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServletRequest.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServletRequest.java?rev=1795915&r1=1795914&r2=1795915&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServletRequest.java (original) +++ tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServletRequest.java Tue May 23 13:53:57 2017 @@ -38,13 +38,13 @@ import javax.servlet.ServletInputStream; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletMapping; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpUpgradeHandler; import javax.servlet.http.Part; import javax.servlet.http.PushBuilder; -import javax.servlet.http.ServletMapping; public class TesterHttpServletRequest implements HttpServletRequest { @@ -265,7 +265,7 @@ public class TesterHttpServletRequest im } @Override - public ServletMapping getServletMapping() { + public HttpServletMapping getHttpServletMapping() { throw new RuntimeException("Not implemented"); } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org