mirror of
https://github.com/apache/struts.git
synced 2026-08-06 23:27:07 +00:00
WW-4518 Moves results to dedicated package
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
<%@ page import="org.apache.struts2.result.StrutsResultSupport" %>
|
||||
<!DOCTYPE html>
|
||||
<%@ page
|
||||
language="java"
|
||||
@@ -21,8 +22,8 @@
|
||||
}
|
||||
sourceUrl += "&className=" + inv.getProxy().getConfig().getClassName();
|
||||
|
||||
if (inv.getResult() != null && inv.getResult() instanceof org.apache.struts2.dispatcher.StrutsResultSupport) {
|
||||
sourceUrl += "&page=" + mapping.getNamespace() + "/" + ((org.apache.struts2.dispatcher.StrutsResultSupport) inv.getResult()).getLastFinalLocation();
|
||||
if (inv.getResult() != null && inv.getResult() instanceof StrutsResultSupport) {
|
||||
sourceUrl += "&page=" + mapping.getNamespace() + "/" + ((StrutsResultSupport) inv.getResult()).getLastFinalLocation();
|
||||
}
|
||||
} else {
|
||||
sourceUrl += "?page=" + request.getServletPath();
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.opensymphony.xwork2.interceptor.ValidationAware;
|
||||
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.struts2.dispatcher.ServletRedirectResult;
|
||||
import org.apache.struts2.result.ServletRedirectResult;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dispatcher;
|
||||
package org.apache.struts2.result;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
+2
-2
@@ -19,7 +19,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dispatcher;
|
||||
package org.apache.struts2.result;
|
||||
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
@@ -110,7 +110,7 @@ public class PlainTextResult extends StrutsResultSupport {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.struts2.dispatcher.StrutsResultSupport#doExecute(java.lang.String, com.opensymphony.xwork2.ActionInvocation)
|
||||
* @see org.apache.struts2.result.StrutsResultSupport#doExecute(java.lang.String, com.opensymphony.xwork2.ActionInvocation)
|
||||
*/
|
||||
protected void doExecute(String finalLocation, ActionInvocation invocation) throws Exception {
|
||||
// verify charset
|
||||
+1
-1
@@ -18,7 +18,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.dispatcher;
|
||||
package org.apache.struts2.result;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dispatcher;
|
||||
package org.apache.struts2.result;
|
||||
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.util.reflection.ReflectionExceptionHandler;
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dispatcher;
|
||||
package org.apache.struts2.result;
|
||||
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
+2
-1
@@ -19,7 +19,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dispatcher;
|
||||
package org.apache.struts2.result;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
@@ -30,6 +30,7 @@ import com.opensymphony.xwork2.util.reflection.ReflectionExceptionHandler;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.dispatcher.Dispatcher;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapper;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
||||
import org.apache.struts2.views.util.UrlHelper;
|
||||
+2
-2
@@ -19,7 +19,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dispatcher;
|
||||
package org.apache.struts2.result;
|
||||
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
@@ -214,7 +214,7 @@ public class StreamResult extends StrutsResultSupport {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.apache.struts2.dispatcher.StrutsResultSupport#doExecute(java.lang.String, com.opensymphony.xwork2.ActionInvocation)
|
||||
* @see StrutsResultSupport#doExecute(java.lang.String, com.opensymphony.xwork2.ActionInvocation)
|
||||
*/
|
||||
protected void doExecute(String finalLocation, ActionInvocation invocation) throws Exception {
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dispatcher;
|
||||
package org.apache.struts2.result;
|
||||
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.Result;
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dispatcher;
|
||||
package org.apache.struts2.result;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
@@ -38,7 +38,7 @@ import freemarker.template.TemplateModelException;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.StrutsStatics;
|
||||
import org.apache.struts2.dispatcher.StrutsResultSupport;
|
||||
import org.apache.struts2.result.StrutsResultSupport;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@@ -168,16 +168,16 @@
|
||||
<package name="struts-default" abstract="true">
|
||||
<result-types>
|
||||
<result-type name="chain" class="com.opensymphony.xwork2.ActionChainResult"/>
|
||||
<result-type name="dispatcher" class="org.apache.struts2.dispatcher.ServletDispatcherResult" default="true"/>
|
||||
<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.dispatcher.HttpHeaderResult"/>
|
||||
<result-type name="redirect" class="org.apache.struts2.dispatcher.ServletRedirectResult"/>
|
||||
<result-type name="redirectAction" class="org.apache.struts2.dispatcher.ServletActionRedirectResult"/>
|
||||
<result-type name="stream" class="org.apache.struts2.dispatcher.StreamResult"/>
|
||||
<result-type name="velocity" class="org.apache.struts2.dispatcher.VelocityResult"/>
|
||||
<result-type name="httpheader" class="org.apache.struts2.result.HttpHeaderResult"/>
|
||||
<result-type name="redirect" class="org.apache.struts2.result.ServletRedirectResult"/>
|
||||
<result-type name="redirectAction" class="org.apache.struts2.result.ServletActionRedirectResult"/>
|
||||
<result-type name="stream" class="org.apache.struts2.result.StreamResult"/>
|
||||
<result-type name="velocity" class="org.apache.struts2.result.VelocityResult"/>
|
||||
<result-type name="xslt" class="org.apache.struts2.views.xslt.XSLTResult"/>
|
||||
<result-type name="plainText" class="org.apache.struts2.dispatcher.PlainTextResult" />
|
||||
<result-type name="postback" class="org.apache.struts2.dispatcher.PostbackResult" />
|
||||
<result-type name="plainText" class="org.apache.struts2.result.PlainTextResult" />
|
||||
<result-type name="postback" class="org.apache.struts2.result.PostbackResult" />
|
||||
</result-types>
|
||||
|
||||
<interceptors>
|
||||
|
||||
@@ -39,7 +39,7 @@ import com.opensymphony.xwork2.security.DefaultExcludedPatternsChecker;
|
||||
import com.opensymphony.xwork2.security.ExcludedPatternsChecker;
|
||||
import com.opensymphony.xwork2.util.location.LocatableProperties;
|
||||
import com.opensymphony.xwork2.validator.ValidationInterceptor;
|
||||
import org.apache.struts2.dispatcher.ServletDispatcherResult;
|
||||
import org.apache.struts2.result.ServletDispatcherResult;
|
||||
import org.apache.struts2.interceptor.TokenInterceptor;
|
||||
import org.apache.struts2.interceptor.TokenSessionStoreInterceptor;
|
||||
import org.apache.struts2.views.jsp.ui.DoubleValidationAction;
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ import com.opensymphony.xwork2.config.entities.PackageConfig;
|
||||
import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.StrutsInternalTestCase;
|
||||
import org.apache.struts2.dispatcher.StrutsResultSupport;
|
||||
import org.apache.struts2.result.StrutsResultSupport;
|
||||
import org.apache.struts2.views.jsp.StrutsMockHttpServletRequest;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.struts2.StrutsInternalTestCase;
|
||||
import org.apache.struts2.dispatcher.ServletActionRedirectResult;
|
||||
import org.apache.struts2.result.ServletActionRedirectResult;
|
||||
import org.easymock.EasyMock;
|
||||
|
||||
import com.opensymphony.xwork2.Action;
|
||||
|
||||
+2
-1
@@ -19,7 +19,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dispatcher;
|
||||
package org.apache.struts2.result;
|
||||
|
||||
import com.mockobjects.dynamic.C;
|
||||
import com.mockobjects.dynamic.Mock;
|
||||
@@ -28,6 +28,7 @@ import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.util.reflection.ReflectionProvider;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.StrutsInternalTestCase;
|
||||
import org.apache.struts2.result.HttpHeaderResult;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dispatcher;
|
||||
package org.apache.struts2.result;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.mock.MockActionInvocation;
|
||||
+2
-1
@@ -19,7 +19,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dispatcher;
|
||||
package org.apache.struts2.result;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
@@ -31,6 +31,7 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.StrutsInternalTestCase;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapper;
|
||||
import org.apache.struts2.result.ServletActionRedirectResult;
|
||||
import org.apache.struts2.views.util.DefaultUrlHelper;
|
||||
import org.easymock.IMocksControl;
|
||||
import org.springframework.mock.web.MockHttpServletRequest;
|
||||
+2
-1
@@ -19,7 +19,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dispatcher;
|
||||
package org.apache.struts2.result;
|
||||
|
||||
import javax.servlet.RequestDispatcher;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -34,6 +34,7 @@ import org.apache.struts2.StrutsStatics;
|
||||
import com.mockobjects.dynamic.C;
|
||||
import com.mockobjects.dynamic.Mock;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import org.apache.struts2.result.ServletDispatcherResult;
|
||||
|
||||
|
||||
/**
|
||||
+2
-1
@@ -19,7 +19,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dispatcher;
|
||||
package org.apache.struts2.result;
|
||||
|
||||
import static javax.servlet.http.HttpServletResponse.SC_SEE_OTHER;
|
||||
import static org.easymock.EasyMock.createControl;
|
||||
@@ -43,6 +43,7 @@ import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.StrutsInternalTestCase;
|
||||
import org.apache.struts2.StrutsStatics;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapper;
|
||||
import org.apache.struts2.result.ServletRedirectResult;
|
||||
import org.apache.struts2.views.util.DefaultUrlHelper;
|
||||
import org.easymock.IMocksControl;
|
||||
import org.springframework.mock.web.MockHttpServletRequest;
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dispatcher;
|
||||
package org.apache.struts2.result;
|
||||
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
+2
-1
@@ -19,12 +19,13 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dispatcher;
|
||||
package org.apache.struts2.result;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import org.apache.struts2.StrutsInternalTestCase;
|
||||
import org.apache.struts2.result.StrutsResultSupport;
|
||||
import org.easymock.EasyMock;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
+3
-1
@@ -19,9 +19,11 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dispatcher;
|
||||
package org.apache.struts2.result;
|
||||
|
||||
import org.apache.struts2.StrutsInternalTestCase;
|
||||
import org.apache.struts2.result.StrutsResultSupport;
|
||||
import org.apache.struts2.result.VelocityResult;
|
||||
import org.apache.velocity.Template;
|
||||
import org.apache.velocity.app.VelocityEngine;
|
||||
import org.apache.velocity.exception.ParseErrorException;
|
||||
+1
-1
@@ -27,7 +27,7 @@ import com.opensymphony.xwork2.config.entities.PackageConfig;
|
||||
import com.opensymphony.xwork2.config.entities.ResultTypeConfig;
|
||||
import com.opensymphony.xwork2.inject.Container;
|
||||
import junit.framework.TestCase;
|
||||
import org.apache.struts2.dispatcher.ServletDispatcherResult;
|
||||
import org.apache.struts2.result.ServletDispatcherResult;
|
||||
import org.easymock.EasyMock;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
+25
-25
@@ -29,7 +29,7 @@ import org.apache.struts2.convention.actions.NoAnnotationAction;
|
||||
import org.apache.struts2.convention.actions.result.*;
|
||||
import org.apache.struts2.convention.actions.resultpath.ClassLevelResultPathAction;
|
||||
import org.apache.struts2.convention.annotation.Action;
|
||||
import org.apache.struts2.dispatcher.ServletDispatcherResult;
|
||||
import org.apache.struts2.result.ServletDispatcherResult;
|
||||
import org.easymock.EasyMock;
|
||||
import org.easymock.IAnswer;
|
||||
|
||||
@@ -205,7 +205,7 @@ public class DefaultResultMapBuilderTest extends TestCase {
|
||||
assertEquals(4, results.size());
|
||||
assertEquals("success", results.get("success").getName());
|
||||
assertEquals(3, results.get("success").getParams().size());
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletDispatcherResult", results.get("success").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletDispatcherResult", results.get("success").getClassName());
|
||||
assertEquals("/WEB-INF/location/namespace/no-annotation-success.jsp", results.get("success").getParams().get("location"));
|
||||
assertEquals(1, results.get("input").getParams().size());
|
||||
assertEquals("org.apache.struts2.views.freemarker.FreemarkerResult", results.get("input").getClassName());
|
||||
@@ -214,7 +214,7 @@ public class DefaultResultMapBuilderTest extends TestCase {
|
||||
assertEquals("org.apache.struts2.views.freemarker.FreemarkerResult", results.get("error").getClassName());
|
||||
assertEquals("/WEB-INF/location/namespace/no-annotation.ftl", results.get("error").getParams().get("location"));
|
||||
assertEquals(3, results.get("failure").getParams().size());
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletDispatcherResult", results.get("success").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletDispatcherResult", results.get("success").getClassName());
|
||||
assertEquals("/WEB-INF/location/namespace/no-annotation-failure.jsp", results.get("failure").getParams().get("location"));
|
||||
EasyMock.verify(context);
|
||||
|
||||
@@ -243,7 +243,7 @@ public class DefaultResultMapBuilderTest extends TestCase {
|
||||
|
||||
assertEquals("success", results.get("success").getName());
|
||||
assertEquals(3, results.get("success").getParams().size());
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletDispatcherResult", results.get("success").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletDispatcherResult", results.get("success").getClassName());
|
||||
assertEquals("/WEB-INF/location/namespace/no-annotation/success.jsp", results.get("success").getParams().get("location"));
|
||||
|
||||
assertEquals(1, results.get("index").getParams().size());
|
||||
@@ -251,7 +251,7 @@ public class DefaultResultMapBuilderTest extends TestCase {
|
||||
assertEquals("/WEB-INF/location/namespace/no-annotation/index.ftl", results.get("index").getParams().get("location"));
|
||||
|
||||
assertEquals(3, results.get("failure").getParams().size());
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletDispatcherResult", results.get("success").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletDispatcherResult", results.get("success").getClassName());
|
||||
assertEquals("/WEB-INF/location/namespace/no-annotation/failure.jsp", results.get("failure").getParams().get("location"));
|
||||
EasyMock.verify(context);
|
||||
}
|
||||
@@ -274,7 +274,7 @@ public class DefaultResultMapBuilderTest extends TestCase {
|
||||
assertEquals(1, results.size());
|
||||
assertEquals("success", results.get("success").getName());
|
||||
assertEquals(3, results.get("success").getParams().size());
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletDispatcherResult", results.get("success").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletDispatcherResult", results.get("success").getClassName());
|
||||
assertEquals("/WEB-INF/location/namespace/no-annotation-success.jsp", results.get("success").getParams().get("location"));
|
||||
EasyMock.verify(context);
|
||||
|
||||
@@ -296,7 +296,7 @@ public class DefaultResultMapBuilderTest extends TestCase {
|
||||
assertEquals(1, results.size());
|
||||
assertEquals("error", results.get("error").getName());
|
||||
assertEquals(3, results.get("error").getParams().size());
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletDispatcherResult", results.get("error").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletDispatcherResult", results.get("error").getClassName());
|
||||
assertEquals("/WEB-INF/location/namespace/error.jsp", results.get("error").getParams().get("location"));
|
||||
assertEquals("value", results.get("error").getParams().get("key"));
|
||||
assertEquals("value1", results.get("error").getParams().get("key1"));
|
||||
@@ -319,7 +319,7 @@ public class DefaultResultMapBuilderTest extends TestCase {
|
||||
assertEquals(1, results.size());
|
||||
assertEquals("error", results.get("error").getName());
|
||||
assertEquals(3, results.get("error").getParams().size());
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletDispatcherResult", results.get("error").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletDispatcherResult", results.get("error").getClassName());
|
||||
assertEquals("/WEB-INF/location/namespace/error.jsp", results.get("error").getParams().get("location"));
|
||||
assertEquals("value", results.get("error").getParams().get("key"));
|
||||
assertEquals("value1", results.get("error").getParams().get("key1"));
|
||||
@@ -342,7 +342,7 @@ public class DefaultResultMapBuilderTest extends TestCase {
|
||||
assertEquals(1, results.size());
|
||||
assertEquals("error", results.get("error").getName());
|
||||
assertEquals(5, results.get("error").getParams().size());
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletDispatcherResult", results.get("error").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletDispatcherResult", results.get("error").getClassName());
|
||||
assertEquals("/WEB-INF/location/namespace/error.jsp", results.get("error").getParams().get("location"));
|
||||
assertEquals("value", results.get("error").getParams().get("key"));
|
||||
assertEquals("value1", results.get("error").getParams().get("key1"));
|
||||
@@ -370,21 +370,21 @@ public class DefaultResultMapBuilderTest extends TestCase {
|
||||
assertEquals("success", results.get("success").getName());
|
||||
assertEquals("failure", results.get("failure").getName());
|
||||
assertEquals(3, results.get("error").getParams().size());
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletDispatcherResult", results.get("error").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletDispatcherResult", results.get("error").getClassName());
|
||||
assertEquals("/WEB-INF/location/namespace/error.jsp", results.get("error").getParams().get("location"));
|
||||
assertEquals("ann-value", results.get("error").getParams().get("key"));
|
||||
assertEquals("ann-value1", results.get("error").getParams().get("key1"));
|
||||
assertEquals(1, results.get("input").getParams().size());
|
||||
assertEquals("foo.action", results.get("input").getParams().get("actionName"));
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletActionRedirectResult", results.get("input").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletActionRedirectResult", results.get("input").getClassName());
|
||||
assertEquals(3, results.get("failure").getParams().size());
|
||||
assertEquals("/WEB-INF/location/namespace/action-failure.jsp", results.get("failure").getParams().get("location"));
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletDispatcherResult", results.get("failure").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletDispatcherResult", results.get("failure").getClassName());
|
||||
assertEquals("value", results.get("failure").getParams().get("key"));
|
||||
assertEquals("value1", results.get("failure").getParams().get("key1"));
|
||||
assertEquals(3, results.get("success").getParams().size());
|
||||
assertEquals("/WEB-INF/location/namespace/action-success.jsp", results.get("success").getParams().get("location"));
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletDispatcherResult", results.get("success").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletDispatcherResult", results.get("success").getClassName());
|
||||
assertEquals("value", results.get("success").getParams().get("key"));
|
||||
assertEquals("value1", results.get("success").getParams().get("key1"));
|
||||
EasyMock.verify(context);
|
||||
@@ -409,21 +409,21 @@ public class DefaultResultMapBuilderTest extends TestCase {
|
||||
assertEquals("success", results.get("success").getName());
|
||||
assertEquals("failure", results.get("failure").getName());
|
||||
assertEquals(3, results.get("error").getParams().size());
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletDispatcherResult", results.get("error").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletDispatcherResult", results.get("error").getClassName());
|
||||
assertEquals("/WEB-INF/location/namespace/error.jsp", results.get("error").getParams().get("location"));
|
||||
assertEquals("ann-value", results.get("error").getParams().get("key"));
|
||||
assertEquals("ann-value1", results.get("error").getParams().get("key1"));
|
||||
assertEquals(1, results.get("input").getParams().size());
|
||||
assertEquals("foo.action", results.get("input").getParams().get("actionName"));
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletActionRedirectResult", results.get("input").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletActionRedirectResult", results.get("input").getClassName());
|
||||
assertEquals(3, results.get("failure").getParams().size());
|
||||
assertEquals("/WEB-INF/location/namespace/action-failure.jsp", results.get("failure").getParams().get("location"));
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletDispatcherResult", results.get("failure").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletDispatcherResult", results.get("failure").getClassName());
|
||||
assertEquals("value", results.get("failure").getParams().get("key"));
|
||||
assertEquals("value1", results.get("failure").getParams().get("key1"));
|
||||
assertEquals(3, results.get("success").getParams().size());
|
||||
assertEquals("/WEB-INF/location/namespace/action-success.jsp", results.get("success").getParams().get("location"));
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletDispatcherResult", results.get("success").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletDispatcherResult", results.get("success").getClassName());
|
||||
assertEquals("value", results.get("success").getParams().get("key"));
|
||||
assertEquals("value1", results.get("success").getParams().get("key1"));
|
||||
EasyMock.verify(context);
|
||||
@@ -445,7 +445,7 @@ public class DefaultResultMapBuilderTest extends TestCase {
|
||||
assertEquals(1, results.size());
|
||||
assertEquals("success", results.get("success").getName());
|
||||
assertEquals(3, results.get("success").getParams().size());
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletDispatcherResult", results.get("success").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletDispatcherResult", results.get("success").getClassName());
|
||||
assertEquals("/WEB-INF/location/namespace/action-success.jsp", results.get("success").getParams().get("location"));
|
||||
assertEquals("value", results.get("success").getParams().get("key"));
|
||||
assertEquals("value1", results.get("success").getParams().get("key1"));
|
||||
@@ -471,26 +471,26 @@ public class DefaultResultMapBuilderTest extends TestCase {
|
||||
assertEquals("success", results.get("success").getName());
|
||||
assertEquals("failure", results.get("failure").getName());
|
||||
assertEquals(3, results.get("error").getParams().size());
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletDispatcherResult", results.get("error").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletDispatcherResult", results.get("error").getClassName());
|
||||
assertEquals("/WEB-INF/location/namespace/error.jsp", results.get("error").getParams().get("location"));
|
||||
assertEquals("value", results.get("success").getParams().get("key"));
|
||||
assertEquals("value1", results.get("success").getParams().get("key1"));
|
||||
assertEquals(1, results.get("input").getParams().size());
|
||||
assertEquals("foo.action", results.get("input").getParams().get("actionName"));
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletActionRedirectResult", results.get("input").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletActionRedirectResult", results.get("input").getClassName());
|
||||
assertEquals(3, results.get("failure").getParams().size());
|
||||
assertEquals("/WEB-INF/location/namespace/action-failure.jsp", results.get("failure").getParams().get("location"));
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletDispatcherResult", results.get("failure").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletDispatcherResult", results.get("failure").getClassName());
|
||||
assertEquals(3, results.get("success").getParams().size());
|
||||
assertEquals("/WEB-INF/location/namespace/action-success.jsp", results.get("success").getParams().get("location"));
|
||||
assertEquals("org.apache.struts2.dispatcher.ServletDispatcherResult", results.get("success").getClassName());
|
||||
assertEquals("org.apache.struts2.result.ServletDispatcherResult", results.get("success").getClassName());
|
||||
EasyMock.verify(context);
|
||||
}
|
||||
|
||||
public void testClassPath() throws Exception {
|
||||
ServletContext context = EasyMock.createNiceMock(ServletContext.class);
|
||||
|
||||
ResultTypeConfig resultType = new ResultTypeConfig.Builder("freemarker", "org.apache.struts2.dispatcher.ServletDispatcherResult").
|
||||
ResultTypeConfig resultType = new ResultTypeConfig.Builder("freemarker", "org.apache.struts2.result.ServletDispatcherResult").
|
||||
defaultResultParam("location").build();
|
||||
PackageConfig packageConfig = new PackageConfig.Builder("package").
|
||||
defaultResultType("dispatcher").addResultTypeConfig(resultType).build();
|
||||
@@ -514,11 +514,11 @@ public class DefaultResultMapBuilderTest extends TestCase {
|
||||
}
|
||||
|
||||
private PackageConfig createPackageConfigBuilder(String namespace) {
|
||||
ResultTypeConfig resultType = new ResultTypeConfig.Builder("dispatcher", "org.apache.struts2.dispatcher.ServletDispatcherResult").
|
||||
ResultTypeConfig resultType = new ResultTypeConfig.Builder("dispatcher", "org.apache.struts2.result.ServletDispatcherResult").
|
||||
addParam("key", "value").addParam("key1", "value1").defaultResultParam("location").build();
|
||||
|
||||
ResultTypeConfig redirect = new ResultTypeConfig.Builder("redirectAction",
|
||||
"org.apache.struts2.dispatcher.ServletActionRedirectResult").defaultResultParam("actionName").build();
|
||||
"org.apache.struts2.result.ServletActionRedirectResult").defaultResultParam("actionName").build();
|
||||
|
||||
ResultTypeConfig ftlResultType = new ResultTypeConfig.Builder("freemarker",
|
||||
"org.apache.struts2.views.freemarker.FreemarkerResult").defaultResultParam("location").build();
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ import org.apache.struts2.convention.actions.transactions.TransNameAction;
|
||||
import org.apache.struts2.convention.annotation.Action;
|
||||
import org.apache.struts2.convention.annotation.Actions;
|
||||
import org.apache.struts2.convention.dontfind.DontFindMeAction;
|
||||
import org.apache.struts2.dispatcher.ServletDispatcherResult;
|
||||
import org.apache.struts2.result.ServletDispatcherResult;
|
||||
import org.easymock.EasyMock;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
@@ -22,7 +22,7 @@ package org.apache.struts2;
|
||||
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.struts2.dispatcher.StrutsResultSupport;
|
||||
import org.apache.struts2.result.StrutsResultSupport;
|
||||
|
||||
/**
|
||||
* Can render jsps from the classpath. "includes" in the jsps must not use relative paths
|
||||
|
||||
+1
-2
@@ -32,11 +32,10 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.dispatcher.StrutsResultSupport;
|
||||
import org.apache.struts2.result.StrutsResultSupport;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.apache.struts2.ServletActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.struts2.result.StrutsResultSupport;
|
||||
import org.jfree.chart.ChartUtilities;
|
||||
import org.jfree.chart.JFreeChart;
|
||||
|
||||
@@ -247,4 +248,4 @@ public class ChartResult extends StrutsResultSupport {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package org.apache.struts2.views.tiles;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import freemarker.template.TemplateException;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.dispatcher.ServletDispatcherResult;
|
||||
import org.apache.struts2.result.ServletDispatcherResult;
|
||||
import org.apache.struts2.portlet.PortletConstants;
|
||||
import org.apache.struts2.portlet.context.PortletActionContext;
|
||||
import org.apache.tiles.TilesContainer;
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ package org.apache.struts2.portlet.result;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.config.entities.ResultConfig;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import org.apache.struts2.dispatcher.ServletActionRedirectResult;
|
||||
import org.apache.struts2.result.ServletActionRedirectResult;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapper;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
||||
import org.apache.struts2.portlet.PortletConstants;
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.dispatcher.StrutsResultSupport;
|
||||
import org.apache.struts2.result.StrutsResultSupport;
|
||||
import org.apache.struts2.portlet.PortletConstants;
|
||||
import org.apache.struts2.portlet.PortletPhase;
|
||||
import org.apache.struts2.portlet.context.PortletActionContext;
|
||||
|
||||
+2
-2
@@ -28,7 +28,7 @@ import org.apache.logging.log4j.Logger;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.dispatcher.StrutsResultSupport;
|
||||
import org.apache.struts2.result.StrutsResultSupport;
|
||||
import org.apache.struts2.portlet.PortletConstants;
|
||||
import org.apache.struts2.portlet.PortletPhase;
|
||||
import org.apache.struts2.portlet.context.PortletActionContext;
|
||||
@@ -115,7 +115,7 @@ public class PortletVelocityResult extends StrutsResultSupport {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.struts2.dispatcher.StrutsResultSupport#doExecute(java.lang.String, com.opensymphony.xwork2.ActionInvocation)
|
||||
* @see org.apache.struts2.result.StrutsResultSupport#doExecute(java.lang.String, com.opensymphony.xwork2.ActionInvocation)
|
||||
*/
|
||||
public void doExecute(String location, ActionInvocation invocation) throws Exception {
|
||||
PortletPhase phase = PortletActionContext.getPhase();
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import freemarker.template.TemplateException;
|
||||
import freemarker.template.TemplateModel;
|
||||
import freemarker.template.TemplateModelException;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.dispatcher.StrutsResultSupport;
|
||||
import org.apache.struts2.result.StrutsResultSupport;
|
||||
import org.apache.struts2.portlet.PortletConstants;
|
||||
import org.apache.struts2.portlet.PortletPhase;
|
||||
import org.apache.struts2.portlet.context.PortletActionContext;
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.dispatcher.HttpHeaderResult;
|
||||
import org.apache.struts2.result.HttpHeaderResult;
|
||||
import org.apache.struts2.rest.handler.ContentTypeHandler;
|
||||
import org.apache.struts2.rest.handler.HtmlHandler;
|
||||
|
||||
|
||||
@@ -48,10 +48,10 @@
|
||||
|
||||
<package name="rest-default" extends="struts-default">
|
||||
<result-types>
|
||||
<result-type name="redirect" class="org.apache.struts2.dispatcher.ServletRedirectResult">
|
||||
<result-type name="redirect" class="org.apache.struts2.result.ServletRedirectResult">
|
||||
<param name="statusCode">303</param>
|
||||
</result-type>
|
||||
<result-type name="redirectAction" class="org.apache.struts2.dispatcher.ServletActionRedirectResult">
|
||||
<result-type name="redirectAction" class="org.apache.struts2.result.ServletActionRedirectResult">
|
||||
<param name="statusCode">303</param>
|
||||
</result-type>
|
||||
</result-types>
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.opensymphony.xwork2.ognl.OgnlUtil;
|
||||
import com.opensymphony.xwork2.util.XWorkTestCaseHelper;
|
||||
import junit.framework.TestCase;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.dispatcher.HttpHeaderResult;
|
||||
import org.apache.struts2.result.HttpHeaderResult;
|
||||
import org.springframework.mock.web.MockHttpServletRequest;
|
||||
import org.springframework.mock.web.MockHttpServletResponse;
|
||||
|
||||
@@ -174,7 +174,7 @@ public class RestActionInvocationTest extends TestCase {
|
||||
|
||||
restActionInvocation.setDefaultErrorResultName("default-error");
|
||||
ResultConfig resultConfig = new ResultConfig.Builder("default-error",
|
||||
"org.apache.struts2.dispatcher.HttpHeaderResult")
|
||||
"org.apache.struts2.result.HttpHeaderResult")
|
||||
.addParam("status", "123").build();
|
||||
ActionConfig actionConfig = new ActionConfig.Builder("org.apache.rest",
|
||||
"RestAction", "org.apache.rest.RestAction")
|
||||
@@ -219,7 +219,7 @@ public class RestActionInvocationTest extends TestCase {
|
||||
|
||||
// Define result 'success'
|
||||
ResultConfig resultConfig = new ResultConfig.Builder("success",
|
||||
"org.apache.struts2.dispatcher.HttpHeaderResult")
|
||||
"org.apache.struts2.result.HttpHeaderResult")
|
||||
.addParam("status", "123").build();
|
||||
ActionConfig actionConfig = new ActionConfig.Builder("org.apache.rest",
|
||||
"RestAction", "org.apache.rest.RestAction")
|
||||
|
||||
@@ -26,7 +26,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.dispatcher.ServletDispatcherResult;
|
||||
import org.apache.struts2.result.ServletDispatcherResult;
|
||||
import org.apache.tiles.TilesContainer;
|
||||
import org.apache.tiles.access.TilesAccess;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ package org.apache.struts2.views.tiles;
|
||||
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.dispatcher.ServletDispatcherResult;
|
||||
import org.apache.struts2.result.ServletDispatcherResult;
|
||||
import org.apache.tiles.TilesContainer;
|
||||
import org.apache.tiles.access.TilesAccess;
|
||||
import org.apache.tiles.request.ApplicationContext;
|
||||
|
||||
Reference in New Issue
Block a user