Skip to content

Commit

Permalink
Merge pull request #1112 from apache/feature/WW-5459-restructure
Browse files Browse the repository at this point in the history
WW-5459 Moves Action & ActionChainResult into proper packages
  • Loading branch information
lukaszlenart authored Nov 3, 2024
2 parents b0f2f0a + b835e89 commit 957783b
Show file tree
Hide file tree
Showing 139 changed files with 162 additions and 146 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.apache.struts2.showcase.action;

import org.apache.struts2.Action;
import org.apache.struts2.action.Action;
import org.apache.struts2.interceptor.annotations.After;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.ajax;

import org.apache.struts2.Action;
import org.apache.struts2.action.Action;
import org.apache.struts2.interceptor.parameter.StrutsParameter;

import java.io.Serializable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
package org.apache.struts2.showcase.chat;


import org.apache.struts2.Action;
import org.apache.struts2.action.Action;
import org.apache.struts2.ActionContext;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.interceptor.AbstractInterceptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.chat;

import org.apache.struts2.Action;
import org.apache.struts2.action.Action;
import org.apache.struts2.ActionContext;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.interceptor.AbstractInterceptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
package org.apache.struts2.showcase.filedownload;

import org.apache.struts2.Action;
import org.apache.struts2.action.Action;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.parameter.StrutsParameter;

Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/org/apache/struts2/ActionContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.jsp.PageContext;
import org.apache.struts2.action.Action;
import org.apache.struts2.conversion.impl.ConversionData;
import org.apache.struts2.dispatcher.HttpParameters;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/org/apache/struts2/ActionInvocation.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
*/
package org.apache.struts2;

import org.apache.struts2.action.Action;
import org.apache.struts2.interceptor.PreResultListener;
import org.apache.struts2.result.ActionChainResult;
import org.apache.struts2.result.Result;
import org.apache.struts2.util.ValueStack;

Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/org/apache/struts2/ActionSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.action.Action;
import org.apache.struts2.conversion.impl.ConversionData;
import org.apache.struts2.inject.Container;
import org.apache.struts2.inject.Inject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import ognl.NoSuchPropertyException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.action.Action;
import org.apache.struts2.config.ConfigurationException;
import org.apache.struts2.config.entities.ActionConfig;
import org.apache.struts2.config.entities.InterceptorMapping;
Expand All @@ -33,6 +34,7 @@
import org.apache.struts2.interceptor.PreResultListener;
import org.apache.struts2.interceptor.WithLazyParams;
import org.apache.struts2.ognl.OgnlUtil;
import org.apache.struts2.result.ActionChainResult;
import org.apache.struts2.result.Result;
import org.apache.struts2.util.ValueStack;
import org.apache.struts2.util.ValueStackFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2;
package org.apache.struts2.action;

/**
* All actions <b>may</b> implement this interface, which exposes the <code>execute()</code> method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.apache.struts2.config.providers;

import org.apache.struts2.Action;
import org.apache.struts2.action.Action;
import org.apache.struts2.ObjectFactory;
import org.apache.struts2.config.BeanSelectionProvider;
import org.apache.struts2.config.Configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.ActionChainResult;
import org.apache.struts2.result.ActionChainResult;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.Unchainable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.apache.commons.lang3.reflect.MethodUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.Action;
import org.apache.struts2.action.Action;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.interceptor.annotations.InputConfig;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@
*/
package org.apache.struts2.interceptor;

import org.apache.struts2.Action;
import org.apache.struts2.action.Action;
import org.apache.struts2.ActionContext;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.ActionProxy;
import org.apache.struts2.config.entities.ResultConfig;
import org.apache.struts2.inject.Container;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.interceptor.MethodFilterInterceptor;
import jakarta.servlet.http.HttpSession;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.struts2.interceptor;

import org.apache.struts2.ActionInvocation;
import org.apache.struts2.action.Action;

import java.io.Serializable;

Expand All @@ -42,7 +43,7 @@
* <p>
* Interceptors <b>must</b> be stateless and not assume that a new instance will be created for each request or Action.
* Interceptors may choose to either short-circuit the {@link ActionInvocation} execution and return a return code
* (such as {@link org.apache.struts2.Action#SUCCESS}), or it may choose to do some processing before
* (such as {@link Action#SUCCESS}), or it may choose to do some processing before
* and/or after delegating the rest of the procesing using {@link ActionInvocation#invoke()}.
* </p>
* <!-- END SNIPPET: introduction -->
Expand Down Expand Up @@ -215,7 +216,7 @@ public interface Interceptor extends Serializable {
*
* @param invocation the action invocation
* @return the return code, either returned from {@link ActionInvocation#invoke()}, or from the interceptor itself.
* @throws Exception any system-level error, as defined in {@link org.apache.struts2.Action#execute()}.
* @throws Exception any system-level error, as defined in {@link Action#execute()}.
*/
String intercept(ActionInvocation invocation) throws Exception;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@

/**
* PreResultListeners may be registered with an {@link ActionInvocation} to get a callback after the
* {@link org.apache.struts2.Action} has been executed but before the {@link Result}
* {@link org.apache.struts2.action.Action} has been executed but before the {@link Result}
* is executed.
*
* @author Jason Carreira
*/
public interface PreResultListener {

/**
* This callback method will be called after the {@link org.apache.struts2.Action} execution and
* This callback method will be called after the {@link org.apache.struts2.action.Action} execution and
* before the {@link Result} execution.
*
* @param invocation the action invocation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.apache.struts2.Action;
import org.apache.struts2.action.Action;

/**
* <!-- START SNIPPET: description -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
*/
package org.apache.struts2.interceptor.parameter;

import org.apache.struts2.action.Action;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Used to annotate public getter/setter methods or fields on {@link org.apache.struts2.Action} classes that are
* Used to annotate public getter/setter methods or fields on {@link Action} classes that are
* intended for parameter injection by the {@link ParametersInterceptor}.
*
* @since 6.4.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2;
package org.apache.struts2.result;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.ActionContext;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.ActionProxy;
import org.apache.struts2.ActionProxyFactory;
import org.apache.struts2.StrutsException;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.result.Result;
import org.apache.struts2.util.TextParseUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.HashSet;
import java.util.LinkedList;
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/apache/struts2/result/Result.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.apache.struts2.result;

import org.apache.struts2.Action;
import org.apache.struts2.action.Action;
import org.apache.struts2.ActionInvocation;

import java.io.Serializable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.apache.struts2.util;

import org.apache.struts2.Action;
import org.apache.struts2.action.Action;

import java.util.ArrayList;
import java.util.Iterator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.apache.struts2.util;

import org.apache.struts2.Action;
import org.apache.struts2.action.Action;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.apache.struts2.util;

import org.apache.struts2.Action;
import org.apache.struts2.action.Action;

import java.util.ArrayList;
import java.util.Iterator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.apache.struts2.util;

import org.apache.struts2.Action;
import org.apache.struts2.action.Action;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.apache.struts2.util;

import org.apache.struts2.Action;
import org.apache.struts2.action.Action;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/struts-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<package name="struts-default" abstract="true">
<result-types>
<result-type name="chain" class="org.apache.struts2.ActionChainResult"/>
<result-type name="chain" class="org.apache.struts2.result.ActionChainResult"/>
<result-type name="dispatcher" class="org.apache.struts2.result.ServletDispatcherResult" default="true"/>
<result-type name="freemarker" class="org.apache.struts2.views.freemarker.FreemarkerResult"/>
<result-type name="httpheader" class="org.apache.struts2.result.HttpHeaderResult"/>
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/xwork-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<package name="xwork-default" abstract="true">

<result-types>
<result-type name="chain" class="org.apache.struts2.ActionChainResult"/>
<result-type name="chain" class="org.apache.struts2.result.ActionChainResult"/>
</result-types>
<interceptors>
<interceptor name="logger" class="org.apache.struts2.interceptor.LoggingInterceptor"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.struts2;

import org.apache.struts2.result.ActionChainResult;
import org.apache.struts2.result.Result;
import org.junit.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.struts2;

import org.apache.struts2.action.Action;
import org.apache.struts2.config.Configuration;
import org.apache.struts2.config.ConfigurationProvider;
import org.apache.struts2.config.entities.ActionConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.struts2;

import org.apache.struts2.action.Action;
import org.apache.struts2.conversion.impl.ConversionData;
import org.apache.struts2.util.ValueStack;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/java/org/apache/struts2/ChainResultTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import com.mockobjects.dynamic.Mock;
import org.apache.struts2.config.providers.XmlConfigurationProvider;
import org.apache.struts2.mock.MockResult;
import org.apache.struts2.result.ActionChainResult;
import org.apache.struts2.util.ValueStack;
import junit.framework.TestCase;
import org.apache.struts2.StrutsException;
import org.apache.struts2.config.StrutsXmlConfigurationProvider;

import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.apache.struts2.mock.MockActionProxy;
import org.apache.struts2.mock.MockInterceptor;
import org.apache.struts2.mock.MockResult;
import org.apache.struts2.result.ActionChainResult;
import org.apache.struts2.result.Result;
import org.apache.struts2.util.ValueStack;
import org.apache.struts2.util.ValueStackFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/
package org.apache.struts2;

import org.apache.struts2.action.Action;

public class ExternalReferenceAction implements Action {

private Foo foo;
Expand Down
1 change: 1 addition & 0 deletions core/src/test/java/org/apache/struts2/NestedAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.apache.struts2;

import org.apache.struts2.action.Action;
import org.apache.struts2.util.ValueStack;
import org.junit.Assert;

Expand Down
2 changes: 2 additions & 0 deletions core/src/test/java/org/apache/struts2/SimpleFooAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
package org.apache.struts2;


import org.apache.struts2.action.Action;

/**
* DOCUMENT ME!
*
Expand Down
3 changes: 1 addition & 2 deletions core/src/test/java/org/apache/struts2/TestAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
*/
package org.apache.struts2;

import org.apache.struts2.Action;
import org.apache.struts2.ActionSupport;
import org.apache.struts2.action.Action;
import org.apache.struts2.util.ValueStack;
import org.apache.struts2.validator.annotations.RequiredFieldValidator;
import org.apache.struts2.validator.annotations.RequiredStringValidator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
*/
package org.apache.struts2;

import org.apache.struts2.Action;
import org.apache.struts2.ActionProxyFactory;
import org.apache.struts2.DefaultActionProxyFactory;
import org.apache.struts2.ObjectFactory;
import org.apache.struts2.action.Action;
import org.apache.struts2.config.Configuration;
import org.apache.struts2.config.ConfigurationException;
import org.apache.struts2.config.ConfigurationProvider;
Expand Down
Loading

0 comments on commit 957783b

Please sign in to comment.