Repository: struts Updated Branches: refs/heads/master 775d1c8c6 -> 8f75e1a19
WW-4149 Introduces an empty stack Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/8f75e1a1 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/8f75e1a1 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/8f75e1a1 Branch: refs/heads/master Commit: 8f75e1a19dfde5b55bb3265737d81c8bfa8ccb39 Parents: 775d1c8 Author: Lukasz Lenart <lukaszlen...@apache.org> Authored: Wed Apr 26 08:22:19 2017 +0200 Committer: Lukasz Lenart <lukaszlen...@apache.org> Committed: Wed Apr 26 08:22:19 2017 +0200 ---------------------------------------------------------------------- .../struts2/interceptor/NoOpInterceptor.java | 38 ++++++++++++++++++++ core/src/main/resources/struts-default.xml | 6 ++++ 2 files changed, 44 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/struts/blob/8f75e1a1/core/src/main/java/org/apache/struts2/interceptor/NoOpInterceptor.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/struts2/interceptor/NoOpInterceptor.java b/core/src/main/java/org/apache/struts2/interceptor/NoOpInterceptor.java new file mode 100644 index 0000000..0cc101d --- /dev/null +++ b/core/src/main/java/org/apache/struts2/interceptor/NoOpInterceptor.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.struts2.interceptor; + +import com.opensymphony.xwork2.ActionInvocation; +import com.opensymphony.xwork2.interceptor.AbstractInterceptor; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * Interceptor that does nothing, used in the "empty" stack + */ +public class NoOpInterceptor extends AbstractInterceptor { + + private static final Logger LOG = LogManager.getLogger(NoOpInterceptor.class); + + @Override + public String intercept(ActionInvocation invocation) throws Exception { + LOG.trace("Passing invocation forward"); + return invocation.invoke(); + } +} http://git-wip-us.apache.org/repos/asf/struts/blob/8f75e1a1/core/src/main/resources/struts-default.xml ---------------------------------------------------------------------- diff --git a/core/src/main/resources/struts-default.xml b/core/src/main/resources/struts-default.xml index d666541..362e317 100644 --- a/core/src/main/resources/struts-default.xml +++ b/core/src/main/resources/struts-default.xml @@ -238,6 +238,12 @@ <interceptor name="roles" class="org.apache.struts2.interceptor.RolesInterceptor" /> <interceptor name="annotationWorkflow" class="com.opensymphony.xwork2.interceptor.annotations.AnnotationWorkflowInterceptor" /> <interceptor name="multiselect" class="org.apache.struts2.interceptor.MultiselectInterceptor" /> + <interceptor name="noop" class="org.apache.struts2.interceptor.NoOpInterceptor" /> + + <!-- Empty stack - performs no operations --> + <interceptor-stack name="emptyStack"> + <interceptor-ref name="noop"/> + </interceptor-stack> <!-- Basic stack --> <interceptor-stack name="basicStack">