[struts] branch action-context-boost updated: WW-4789 WW-3788 Introduces helper methods to allow build fluent API
This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch action-context-boost in repository https://gitbox.apache.org/repos/asf/struts.git The following commit(s) were added to refs/heads/action-context-boost by this push: new f22eac7 WW-4789 WW-3788 Introduces helper methods to allow build fluent API f22eac7 is described below commit f22eac7f0ab03f6da974e4d0d2427938390a1902 Author: Lukasz Lenart AuthorDate: Sun Apr 5 09:59:55 2020 +0200 WW-4789 WW-3788 Introduces helper methods to allow build fluent API --- .../com/opensymphony/xwork2/ActionContext.java | 64 +- .../xwork2/DefaultActionInvocation.java| 4 +- .../org/apache/struts2/ServletActionContext.java | 6 +- .../interceptor/CreateSessionInterceptor.java | 2 +- .../struts2/interceptor/ScopeInterceptor.java | 56 +-- .../struts2/util/InvocationSessionStore.java | 28 +- .../com/opensymphony/xwork2/ActionContextTest.java | 21 --- .../validator/VisitorFieldValidatorTest.java | 37 - .../struts2/result/ServletRedirectResultTest.java | 4 +- .../views/freemarker/FreeMarkerResultTest.java | 9 +-- .../freemarker/FreemarkerResultMockedTest.java | 9 +-- .../apache/struts2/views/jsp/AbstractTagTest.java | 9 +-- .../org/apache/struts2/views/jsp/URLTagTest.java | 10 ++-- .../org/apache/struts2/EmbeddedJSPResultTest.java | 11 ++-- .../struts2/views/java/simple/AbstractTest.java| 2 +- .../apache/struts2/json/JSONInterceptorTest.java | 13 ++--- .../org/apache/struts2/StrutsJUnit4TestCase.java | 2 +- .../org/apache/struts2/StrutsPortletTestCase.java | 2 +- .../java/org/apache/struts2/StrutsTestCase.java| 2 +- .../rest/ContentTypeHandlerManagerTest.java| 4 +- 20 files changed, 182 insertions(+), 113 deletions(-) diff --git a/core/src/main/java/com/opensymphony/xwork2/ActionContext.java b/core/src/main/java/com/opensymphony/xwork2/ActionContext.java index 95baaab..3a0ff0b 100644 --- a/core/src/main/java/com/opensymphony/xwork2/ActionContext.java +++ b/core/src/main/java/com/opensymphony/xwork2/ActionContext.java @@ -62,7 +62,10 @@ public class ActionContext implements Serializable { /** * Constant for the name of the action being executed. + * + * @deprecated used helper methods instead */ +@Deprecated public static final String ACTION_NAME = "com.opensymphony.xwork2.ActionContext.name"; /** @@ -275,7 +278,9 @@ public class ActionContext implements Serializable { * Sets the name of the current Action in the ActionContext. * * @param name the name of the current action. + * @deprecated use {@link #withActionName(String)} instead */ +@Deprecated public void setName(String name) { put(ACTION_NAME, name); } @@ -290,6 +295,15 @@ public class ActionContext implements Serializable { } /** + * Gets the name of the current Action. + * + * @return the name of the current action. + */ +public String getActionName() { +return (String) get(ACTION_NAME); +} + +/** * Sets the action parameters. * * @param parameters the parameters for the current action. @@ -313,7 +327,9 @@ public class ActionContext implements Serializable { * Sets a map of action session values. * * @param session the session values. + * @deprecated use {@link #withSession(Map)} instead */ +@Deprecated public void setSession(Map session) { put(SESSION, session); } @@ -404,16 +420,19 @@ public class ActionContext implements Serializable { return (HttpServletResponse) get(StrutsStatics.HTTP_RESPONSE); } -public void setServletContext(ServletContext servletContext) { +public ActionContext withServletContext(ServletContext servletContext) { put(StrutsStatics.SERVLET_CONTEXT, servletContext); +return this; } -public void setServletRequest(HttpServletRequest request) { +public ActionContext withServletRequest(HttpServletRequest request) { put(StrutsStatics.HTTP_REQUEST, request); +return this; } -public void setServletResponse(HttpServletResponse response) { +public ActionContext withServletResponse(HttpServletResponse response) { put(StrutsStatics.HTTP_RESPONSE, response); +return this; } public PageContext getPageContext() { @@ -431,4 +450,43 @@ public class ActionContext implements Serializable { public void setActionMapping(ActionMapping actionMapping) { put(StrutsStatics.ACTION_MAPPING, actionMapping); } + +public ActionContext withApplication(Map application) { +put(APPLICATION, application); +return this; +} + +public ActionContext withSession(Map session) { +put(SESSION, session); +return this; +}
[struts] branch action-context-boost updated (f22eac7 -> dfda16d)
This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a change to branch action-context-boost in repository https://gitbox.apache.org/repos/asf/struts.git. discard f22eac7 WW-4789 WW-3788 Introduces helper methods to allow build fluent API new dfda16d WW-4789 WW-3788 Introduces helper methods to allow build fluent API This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (f22eac7) \ N -- N -- N refs/heads/action-context-boost (dfda16d) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../com/opensymphony/xwork2/ActionContext.java | 33 +++-- .../apache/struts2/dispatcher/HttpParameters.java | 1 + .../com/opensymphony/xwork2/ActionContextTest.java | 18 ++--- .../com/opensymphony/xwork2/ActionSupportTest.java | 82 +++--- .../ConversionErrorInterceptorTest.java| 15 ++-- .../ActionAutowiringInterceptorTest.java | 16 ++--- .../ConversionErrorFieldValidatorTest.java | 6 +- .../DefaultActionValidatorManagerTest.java | 5 +- .../validator/DoubleRangeFieldValidatorTest.java | 12 +--- .../xwork2/validator/RegexFieldValidatorTest.java | 34 ++--- ...teConversionErrorFieldValidatorSupportTest.java | 1 - .../validator/VisitorFieldValidatorTest.java | 2 +- .../validator/validators/ValidatorSupportTest.java | 43 +--- .../apache/struts2/components/UIComponentTest.java | 1 - .../interceptor/ServletConfigInterceptorTest.java | 6 +- .../StrutsConversionErrorInterceptorTest.java | 5 +- .../struts2/util/InvocationSessionStoreTest.java | 37 +- .../org/apache/struts2/views/jsp/I18nTagTest.java | 1 - .../org/apache/struts2/views/jsp/IfTagTest.java| 1 - .../apache/struts2/views/jsp/ui/FormTagTest.java | 2 - .../org/apache/struts2/EmbeddedJSPResultTest.java | 17 +++-- .../apache/struts2/dispatcher/ChartResultTest.java | 2 - .../portlet/result/PortletVelocityResult.java | 4 +- .../struts2/views/jsp/PortletUrlTagTest.java | 11 +-- .../struts2/rest/RestWorkflowInterceptorTest.java | 5 +- .../views/velocity/result/VelocityResult.java | 4 +- .../views/velocity/result/VelocityResultTest.java | 1 - 27 files changed, 167 insertions(+), 198 deletions(-)
[struts] 01/01: WW-4789 WW-3788 Introduces helper methods to allow build fluent API
This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch action-context-boost in repository https://gitbox.apache.org/repos/asf/struts.git commit dfda16d7432dfc1a087b6a050884611a9a5ad6ac Author: Lukasz Lenart AuthorDate: Sun Apr 5 09:59:55 2020 +0200 WW-4789 WW-3788 Introduces helper methods to allow build fluent API --- .../com/opensymphony/xwork2/ActionContext.java | 97 +++--- .../xwork2/DefaultActionInvocation.java| 4 +- .../org/apache/struts2/ServletActionContext.java | 6 +- .../apache/struts2/dispatcher/HttpParameters.java | 1 + .../interceptor/CreateSessionInterceptor.java | 2 +- .../struts2/interceptor/ScopeInterceptor.java | 56 ++--- .../struts2/util/InvocationSessionStore.java | 28 +++ .../com/opensymphony/xwork2/ActionContextTest.java | 39 + .../com/opensymphony/xwork2/ActionSupportTest.java | 82 +- .../ConversionErrorInterceptorTest.java| 15 ++-- .../ActionAutowiringInterceptorTest.java | 16 ++-- .../ConversionErrorFieldValidatorTest.java | 6 +- .../DefaultActionValidatorManagerTest.java | 5 +- .../validator/DoubleRangeFieldValidatorTest.java | 12 +-- .../xwork2/validator/RegexFieldValidatorTest.java | 34 ++-- ...teConversionErrorFieldValidatorSupportTest.java | 1 - .../validator/VisitorFieldValidatorTest.java | 39 + .../validator/validators/ValidatorSupportTest.java | 43 -- .../apache/struts2/components/UIComponentTest.java | 1 - .../interceptor/ServletConfigInterceptorTest.java | 6 +- .../StrutsConversionErrorInterceptorTest.java | 5 +- .../struts2/result/ServletRedirectResultTest.java | 4 +- .../struts2/util/InvocationSessionStoreTest.java | 37 + .../views/freemarker/FreeMarkerResultTest.java | 9 +- .../freemarker/FreemarkerResultMockedTest.java | 9 +- .../apache/struts2/views/jsp/AbstractTagTest.java | 9 +- .../org/apache/struts2/views/jsp/I18nTagTest.java | 1 - .../org/apache/struts2/views/jsp/IfTagTest.java| 1 - .../org/apache/struts2/views/jsp/URLTagTest.java | 10 +-- .../apache/struts2/views/jsp/ui/FormTagTest.java | 2 - .../org/apache/struts2/EmbeddedJSPResultTest.java | 16 ++-- .../struts2/views/java/simple/AbstractTest.java| 2 +- .../apache/struts2/dispatcher/ChartResultTest.java | 2 - .../apache/struts2/json/JSONInterceptorTest.java | 13 ++- .../org/apache/struts2/StrutsJUnit4TestCase.java | 2 +- .../org/apache/struts2/StrutsPortletTestCase.java | 2 +- .../java/org/apache/struts2/StrutsTestCase.java| 2 +- .../portlet/result/PortletVelocityResult.java | 4 +- .../struts2/views/jsp/PortletUrlTagTest.java | 11 +-- .../rest/ContentTypeHandlerManagerTest.java| 4 +- .../struts2/rest/RestWorkflowInterceptorTest.java | 5 +- .../views/velocity/result/VelocityResult.java | 4 +- .../views/velocity/result/VelocityResultTest.java | 1 - 43 files changed, 343 insertions(+), 305 deletions(-) diff --git a/core/src/main/java/com/opensymphony/xwork2/ActionContext.java b/core/src/main/java/com/opensymphony/xwork2/ActionContext.java index 95baaab..6647356 100644 --- a/core/src/main/java/com/opensymphony/xwork2/ActionContext.java +++ b/core/src/main/java/com/opensymphony/xwork2/ActionContext.java @@ -21,6 +21,7 @@ package com.opensymphony.xwork2; import com.opensymphony.xwork2.conversion.impl.ConversionData; import com.opensymphony.xwork2.inject.Container; import com.opensymphony.xwork2.util.ValueStack; +import com.sun.org.apache.bcel.internal.generic.ACONST_NULL; import org.apache.struts2.StrutsException; import org.apache.struts2.StrutsStatics; import org.apache.struts2.dispatcher.HttpParameters; @@ -62,7 +63,10 @@ public class ActionContext implements Serializable { /** * Constant for the name of the action being executed. + * + * @deprecated used helper methods instead */ +@Deprecated public static final String ACTION_NAME = "com.opensymphony.xwork2.ActionContext.name"; /** @@ -196,7 +200,9 @@ public class ActionContext implements Serializable { * Sets the action's application context. * * @param application the action's application context. + * @deprecated use {@link #withApplication(Map)} instead */ +@Deprecated public void setApplication(Map application) { put(APPLICATION, application); } @@ -223,7 +229,9 @@ public class ActionContext implements Serializable { * Sets conversion errors which occurred when executing the action. * * @param conversionErrors a Map of errors which occurred when executing the action. + * @deprecated use {@link #withConversionErrors(Map)} instead */ +@Deprecated public void setConversionErrors(Map conversionErrors) { put(CONVERSION_ERRORS, conversionErrors); } @@ -238,8