429 lines
15 KiB
Diff
429 lines
15 KiB
Diff
From ba20922aeae437d7d2d792531c12aa0222e1f77a Mon Sep 17 00:00:00 2001
|
|
From: maminjie <maminjie1@huawei.com>
|
|
Date: Thu, 20 Aug 2020 17:46:35 +0800
|
|
Subject: [PATCH] fix does not override abstract method
|
|
|
|
---
|
|
.../taglib/definition/InitContainerTag.java | 178 ++++++++++++++++-
|
|
.../tiles/web/util/ServletContextAdapter.java | 179 ++++++++++++++++++
|
|
2 files changed, 355 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/InitContainerTag.java b/src/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/InitContainerTag.java
|
|
index d98cb86..64d9858 100644
|
|
--- a/src/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/InitContainerTag.java
|
|
+++ b/src/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/InitContainerTag.java
|
|
@@ -28,11 +28,19 @@ import java.util.Enumeration;
|
|
import java.util.Hashtable;
|
|
import java.util.Iterator;
|
|
import java.util.Set;
|
|
+import java.util.Map;
|
|
+import java.util.EventListener;
|
|
|
|
import javax.servlet.RequestDispatcher;
|
|
import javax.servlet.Servlet;
|
|
import javax.servlet.ServletContext;
|
|
import javax.servlet.ServletException;
|
|
+import javax.servlet.descriptor.JspConfigDescriptor;
|
|
+import javax.servlet.SessionTrackingMode;
|
|
+import javax.servlet.SessionCookieConfig;
|
|
+import javax.servlet.FilterRegistration;
|
|
+import javax.servlet.Filter;
|
|
+import javax.servlet.ServletRegistration;
|
|
|
|
import org.apache.tiles.ArrayStack;
|
|
import org.apache.tiles.AttributeContext;
|
|
@@ -319,8 +327,9 @@ public class InitContainerTag extends TilesBodyTag {
|
|
* @param name The name of the parameter.
|
|
* @param value The value of the parameter.
|
|
*/
|
|
- public void setInitParameter(String name, String value) {
|
|
+ public boolean setInitParameter(String name, String value) {
|
|
initParameters.put(name, value);
|
|
+ return true;
|
|
}
|
|
|
|
/**
|
|
@@ -366,8 +375,173 @@ public class InitContainerTag extends TilesBodyTag {
|
|
public String getContextPath() {
|
|
return rootContext.getContextPath();
|
|
}
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public void setResponseCharacterEncoding(String type) {
|
|
+ rootContext.setResponseCharacterEncoding(type);
|
|
+ }
|
|
|
|
- /**
|
|
+ /** {@inheritDoc} */
|
|
+ public String getResponseCharacterEncoding() {
|
|
+ return rootContext.getResponseCharacterEncoding();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public void setRequestCharacterEncoding(String type) {
|
|
+ rootContext.setRequestCharacterEncoding(type);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public String getRequestCharacterEncoding() {
|
|
+ return rootContext.getRequestCharacterEncoding();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public void setSessionTimeout(int timeout) {
|
|
+ rootContext.setSessionTimeout(timeout);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public int getSessionTimeout() {
|
|
+ return rootContext.getSessionTimeout();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public String getVirtualServerName() {
|
|
+ return rootContext.getVirtualServerName();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public void declareRoles(String... roles) {
|
|
+ rootContext.declareRoles(roles);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public ClassLoader getClassLoader() {
|
|
+ return rootContext.getClassLoader();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public JspConfigDescriptor getJspConfigDescriptor() {
|
|
+ return rootContext.getJspConfigDescriptor();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public <T extends EventListener> T createListener(Class<T> clazz) throws ServletException {
|
|
+ return rootContext.createListener(clazz);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public void addListener(Class <? extends EventListener> listenerClass) {
|
|
+ rootContext.addListener(listenerClass);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public <T extends EventListener> void addListener(T t) {
|
|
+ rootContext.addListener(t);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public void addListener(String className) {
|
|
+ rootContext.addListener(className);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public Set<SessionTrackingMode> getEffectiveSessionTrackingModes() {
|
|
+ return rootContext.getEffectiveSessionTrackingModes();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public Set<SessionTrackingMode> getDefaultSessionTrackingModes() {
|
|
+ return rootContext.getDefaultSessionTrackingModes();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public void setSessionTrackingModes(Set<SessionTrackingMode> sessionTrackingModes) {
|
|
+ rootContext.setSessionTrackingModes(sessionTrackingModes);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public SessionCookieConfig getSessionCookieConfig() {
|
|
+ return rootContext.getSessionCookieConfig();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public Map<String, ? extends FilterRegistration> getFilterRegistrations() {
|
|
+ return rootContext.getFilterRegistrations();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public FilterRegistration getFilterRegistration(String filterName) {
|
|
+ return rootContext.getFilterRegistration(filterName);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public <T extends Filter> T createFilter(Class<T> clazz) throws ServletException {
|
|
+ return rootContext.createFilter(clazz);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public FilterRegistration.Dynamic addFilter(String filterName, Class <? extends Filter> filterClass) {
|
|
+ return rootContext.addFilter(filterName, filterClass);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public FilterRegistration.Dynamic addFilter(String filterName, String className) {
|
|
+ return rootContext.addFilter(filterName, className);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public FilterRegistration.Dynamic addFilter(String filterName, Filter filter) {
|
|
+ return rootContext.addFilter(filterName, filter);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public Map<String, ? extends ServletRegistration> getServletRegistrations() {
|
|
+ return rootContext.getServletRegistrations();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public ServletRegistration getServletRegistration(String servletName) {
|
|
+ return rootContext.getServletRegistration(servletName);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public <T extends Servlet> T createServlet(Class<T> clazz) throws ServletException {
|
|
+ return rootContext.createServlet(clazz);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public ServletRegistration.Dynamic addJspFile(String s1, String s2) {
|
|
+ return rootContext.addJspFile(s1, s2);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public ServletRegistration.Dynamic addServlet(String servletName, Class <? extends Servlet> servletClass) {
|
|
+ return rootContext.addServlet(servletName, servletClass);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public ServletRegistration.Dynamic addServlet(String servletName, Servlet servlet) {
|
|
+ return rootContext.addServlet(servletName, servlet);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public ServletRegistration.Dynamic addServlet(String servletName, String className) {
|
|
+ return rootContext.addServlet(servletName, className);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public int getEffectiveMinorVersion() {
|
|
+ return rootContext.getEffectiveMinorVersion();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public int getEffectiveMajorVersion() {
|
|
+ return rootContext.getEffectiveMajorVersion();
|
|
+ }
|
|
+
|
|
+ /**
|
|
* Composes an enumeration and an iterator into a single enumeration.
|
|
*/
|
|
@SuppressWarnings("unchecked")
|
|
diff --git a/src/tiles-servlet/src/main/java/org/apache/tiles/web/util/ServletContextAdapter.java b/src/tiles-servlet/src/main/java/org/apache/tiles/web/util/ServletContextAdapter.java
|
|
index da6f339..c03e3e1 100644
|
|
--- a/src/tiles-servlet/src/main/java/org/apache/tiles/web/util/ServletContextAdapter.java
|
|
+++ b/src/tiles-servlet/src/main/java/org/apache/tiles/web/util/ServletContextAdapter.java
|
|
@@ -24,14 +24,23 @@ import java.io.InputStream;
|
|
import java.net.MalformedURLException;
|
|
import java.net.URL;
|
|
import java.util.Enumeration;
|
|
+import java.util.EnumSet;
|
|
import java.util.Hashtable;
|
|
+import java.util.Map;
|
|
import java.util.Set;
|
|
+import java.util.EventListener;
|
|
|
|
import javax.servlet.RequestDispatcher;
|
|
import javax.servlet.Servlet;
|
|
import javax.servlet.ServletConfig;
|
|
import javax.servlet.ServletContext;
|
|
import javax.servlet.ServletException;
|
|
+import javax.servlet.descriptor.JspConfigDescriptor;
|
|
+import javax.servlet.SessionTrackingMode;
|
|
+import javax.servlet.SessionCookieConfig;
|
|
+import javax.servlet.FilterRegistration;
|
|
+import javax.servlet.Filter;
|
|
+import javax.servlet.ServletRegistration;
|
|
|
|
/**
|
|
* Adapts a servlet config and a servlet context to become a unique servlet
|
|
@@ -206,6 +215,176 @@ public class ServletContextAdapter implements ServletContext {
|
|
public String getContextPath() {
|
|
return rootContext.getContextPath();
|
|
}
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public void setResponseCharacterEncoding(String type) {
|
|
+ rootContext.setResponseCharacterEncoding(type);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public String getResponseCharacterEncoding() {
|
|
+ return rootContext.getResponseCharacterEncoding();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public void setRequestCharacterEncoding(String type) {
|
|
+ rootContext.setRequestCharacterEncoding(type);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public String getRequestCharacterEncoding() {
|
|
+ return rootContext.getRequestCharacterEncoding();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public void setSessionTimeout(int timeout) {
|
|
+ rootContext.setSessionTimeout(timeout);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public int getSessionTimeout() {
|
|
+ return rootContext.getSessionTimeout();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public String getVirtualServerName() {
|
|
+ return rootContext.getVirtualServerName();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public void declareRoles(String... roles) {
|
|
+ rootContext.declareRoles(roles);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public ClassLoader getClassLoader() {
|
|
+ return rootContext.getClassLoader();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public JspConfigDescriptor getJspConfigDescriptor() {
|
|
+ return rootContext.getJspConfigDescriptor();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public <T extends EventListener> T createListener(Class<T> clazz) throws ServletException {
|
|
+ return rootContext.createListener(clazz);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public void addListener(Class <? extends EventListener> listenerClass) {
|
|
+ rootContext.addListener(listenerClass);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public <T extends EventListener> void addListener(T t) {
|
|
+ rootContext.addListener(t);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public void addListener(String className) {
|
|
+ rootContext.addListener(className);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public Set<SessionTrackingMode> getEffectiveSessionTrackingModes() {
|
|
+ return rootContext.getEffectiveSessionTrackingModes();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public Set<SessionTrackingMode> getDefaultSessionTrackingModes() {
|
|
+ return rootContext.getDefaultSessionTrackingModes();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public void setSessionTrackingModes(Set<SessionTrackingMode> sessionTrackingModes) {
|
|
+ rootContext.setSessionTrackingModes(sessionTrackingModes);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public SessionCookieConfig getSessionCookieConfig() {
|
|
+ return rootContext.getSessionCookieConfig();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public Map<String, ? extends FilterRegistration> getFilterRegistrations() {
|
|
+ return rootContext.getFilterRegistrations();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public FilterRegistration getFilterRegistration(String filterName) {
|
|
+ return rootContext.getFilterRegistration(filterName);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public <T extends Filter> T createFilter(Class<T> clazz) throws ServletException {
|
|
+ return rootContext.createFilter(clazz);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public FilterRegistration.Dynamic addFilter(String filterName, Class <? extends Filter> filterClass) {
|
|
+ return rootContext.addFilter(filterName, filterClass);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public FilterRegistration.Dynamic addFilter(String filterName, String className) {
|
|
+ return rootContext.addFilter(filterName, className);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public FilterRegistration.Dynamic addFilter(String filterName, Filter filter) {
|
|
+ return rootContext.addFilter(filterName, filter);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public Map<String, ? extends ServletRegistration> getServletRegistrations() {
|
|
+ return rootContext.getServletRegistrations();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public ServletRegistration getServletRegistration(String servletName) {
|
|
+ return rootContext.getServletRegistration(servletName);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public <T extends Servlet> T createServlet(Class<T> clazz) throws ServletException {
|
|
+ return rootContext.createServlet(clazz);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public ServletRegistration.Dynamic addJspFile(String s1, String s2) {
|
|
+ return rootContext.addJspFile(s1, s2);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public ServletRegistration.Dynamic addServlet(String servletName, Class <? extends Servlet> servletClass) {
|
|
+ return rootContext.addServlet(servletName, servletClass);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public ServletRegistration.Dynamic addServlet(String servletName, Servlet servlet) {
|
|
+ return rootContext.addServlet(servletName, servlet);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public ServletRegistration.Dynamic addServlet(String servletName, String className) {
|
|
+ return rootContext.addServlet(servletName, className);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public boolean setInitParameter(String name, String value) {
|
|
+ return rootContext.setInitParameter(name, value);
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public int getEffectiveMinorVersion() {
|
|
+ return rootContext.getEffectiveMinorVersion();
|
|
+ }
|
|
+
|
|
+ /** {@inheritDoc} */
|
|
+ public int getEffectiveMajorVersion() {
|
|
+ return rootContext.getEffectiveMajorVersion();
|
|
+ }
|
|
|
|
/**
|
|
* Composes an enumeration into a single one.
|
|
--
|
|
2.23.0
|
|
|