[5/5] struts git commit: Add java doc for MethodFilterInterceptor
Add java doc for MethodFilterInterceptor Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/16179401 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/16179401 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/16179401 Branch: refs/heads/master Commit: 161794013843364159972f8947262a44b6bdbc34 Parents: d73a847 Author: gregh3269 Authored: Thu Aug 4 08:31:32 2016 +0100 Committer: Lukasz Lenart Committed: Wed Sep 28 10:36:39 2016 +0200 -- .../xwork2/interceptor/ConversionErrorInterceptor.java | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/struts/blob/16179401/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java -- diff --git a/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java b/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java index f7234e7..67fc1ad 100644 --- a/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java +++ b/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java @@ -37,7 +37,13 @@ import java.util.Map; * display the original string ("abc") again rather than the int value (likely 0, which would make very little sense to * the user). * - * + * + * + * Note: Since 2.5.2, this interceptor extends {@link MethodFilterInterceptor}, therefore being + * able to deal with excludeMethods / includeMethods parameters. See [Workflow Interceptor] + * (class {@link DefaultWorkflowInterceptor}) for documentation and examples on how to use this feature. + * + * * * * Interceptor parameters:
[2/5] struts git commit: Revert "WW-4628: proper decoding of parameters in query-string"
Revert "WW-4628: proper decoding of parameters in query-string" This reverts commit ef9c66118ede16f3ff239ea864641d5bdadeecae. Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/d9fe1406 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/d9fe1406 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/d9fe1406 Branch: refs/heads/master Commit: d9fe1406ee287226704fdd5e3a53d59e6b0a556f Parents: 1617940 Author: gregh3269 Authored: Thu Aug 4 08:57:25 2016 +0100 Committer: Lukasz Lenart Committed: Wed Sep 28 10:36:39 2016 +0200 -- .../org/apache/struts2/util/URLDecoderUtil.java | 12 .../struts2/views/util/DefaultUrlHelper.java| 27 +++- .../apache/struts2/util/URLDecoderUtilTest.java | 7 -- .../views/util/DefaultUrlHelperTest.java| 71 +++- 4 files changed, 64 insertions(+), 53 deletions(-) -- http://git-wip-us.apache.org/repos/asf/struts/blob/d9fe1406/core/src/main/java/org/apache/struts2/util/URLDecoderUtil.java -- diff --git a/core/src/main/java/org/apache/struts2/util/URLDecoderUtil.java b/core/src/main/java/org/apache/struts2/util/URLDecoderUtil.java index 3c61d1e..10f2a78 100644 --- a/core/src/main/java/org/apache/struts2/util/URLDecoderUtil.java +++ b/core/src/main/java/org/apache/struts2/util/URLDecoderUtil.java @@ -19,16 +19,4 @@ public class URLDecoderUtil { return UDecoder.URLDecode(sequence, charset); } -/** - * Decodes a x-www-form-urlencoded string. - * @param sequence the String to decode - * @param charset The name of a supported character encoding. - * @param isQueryString whether input is a query string. If true other decoding rules apply. - * @return the newly decoded String - * @exception IllegalArgumentException If the encoding is not valid - */ -public static String decode(String sequence, String charset, boolean isQueryString) { -return UDecoder.URLDecode(sequence, charset, isQueryString); -} - } http://git-wip-us.apache.org/repos/asf/struts/blob/d9fe1406/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java -- diff --git a/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java b/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java index 668d1a9..16739af 100644 --- a/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java +++ b/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java @@ -284,25 +284,14 @@ public class DefaultUrlHelper implements UrlHelper { * @return the encoded string */ public String decode( String input ) { -return URLDecoderUtil.decode(input, encoding, false); + try { +return URLDecoderUtil.decode(input, encoding); + } catch (Exception e) { + LOG.warn("Could not decode URL parameter '{}', returning value un-decoded", input); + return input; + } } -/** - * Decodes the URL using {@link URLDecoderUtil#decode(String, String, boolean)} with the encoding specified in the configuration. - * - * @param input the input to decode - * @param isQueryString whether input is a query string. If true other decoding rules apply. - * @return the encoded string - */ -public String decode( String input, boolean isQueryString ) { -try { -return URLDecoderUtil.decode(input, encoding, isQueryString); -} catch (Exception e) { -LOG.warn("Could not decode URL parameter '{}', returning value un-decoded", input); -return input; -} -} - public Map parseQueryString(String queryString, boolean forceValueArray) { Map queryParams = new LinkedHashMap(); if (queryString != null) { @@ -319,8 +308,8 @@ public class DefaultUrlHelper implements UrlHelper { paramValue = tmpParams[1]; } if (paramName != null) { -paramName = decode(paramName, true); -String translatedParamValue = decode(paramValue, true); +paramName = decode(paramName); +String translatedParamValue = decode(paramValue); if (queryParams.containsKey(paramName) || forceValueArray) { // WW-1619 append new param value to existing value(s) http://git-wip-us.apache.org/repos/asf/struts/blob/d9fe1406/core/src/test/java/org/apache/struts2/util/URLDecoderUtilTest.java -- diff --gi
[3/5] struts git commit: ConversionErrorInterceptor to extend MethodFilterIntercept. See WW-4676
ConversionErrorInterceptor to extend MethodFilterIntercept. See WW-4676 Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/d73a8471 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/d73a8471 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/d73a8471 Branch: refs/heads/master Commit: d73a8471a62604f66b22b054cb2cf08e093b27a3 Parents: e7ce5dc Author: gregh3269 Authored: Wed Aug 3 10:50:44 2016 +0100 Committer: Lukasz Lenart Committed: Wed Sep 28 10:36:39 2016 +0200 -- .../xwork2/interceptor/ConversionErrorInterceptor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/struts/blob/d73a8471/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java -- diff --git a/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java b/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java index 6a82e04..f7234e7 100644 --- a/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java +++ b/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java @@ -75,7 +75,7 @@ import java.util.Map; * * @author Jason Carreira */ -public class ConversionErrorInterceptor extends AbstractInterceptor { +public class ConversionErrorInterceptor extends MethodFilterInterceptor { public static final String ORIGINAL_PROPERTY_OVERRIDE = "original.property.override"; @@ -88,7 +88,7 @@ public class ConversionErrorInterceptor extends AbstractInterceptor { } @Override -public String intercept(ActionInvocation invocation) throws Exception { +public String doIntercept(ActionInvocation invocation) throws Exception { ActionContext invocationContext = invocation.getInvocationContext(); Map conversionErrors = invocationContext.getConversionErrors();
[1/5] struts git commit: Fixes failing test
Repository: struts Updated Branches: refs/heads/master e7ce5dcc0 -> 6c2ff6f15 Fixes failing test Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/6c2ff6f1 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/6c2ff6f1 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/6c2ff6f1 Branch: refs/heads/master Commit: 6c2ff6f153f7c4ab1eb3d92bc7ab2f401d40aebd Parents: 6b22901 Author: Lukasz Lenart Authored: Wed Sep 28 10:35:06 2016 +0200 Committer: Lukasz Lenart Committed: Wed Sep 28 10:36:39 2016 +0200 -- .../interceptor/StrutsConversionErrorInterceptorTest.java| 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/struts/blob/6c2ff6f1/core/src/test/java/org/apache/struts2/interceptor/StrutsConversionErrorInterceptorTest.java -- diff --git a/core/src/test/java/org/apache/struts2/interceptor/StrutsConversionErrorInterceptorTest.java b/core/src/test/java/org/apache/struts2/interceptor/StrutsConversionErrorInterceptorTest.java index b7d1016..fdf4c59 100644 --- a/core/src/test/java/org/apache/struts2/interceptor/StrutsConversionErrorInterceptorTest.java +++ b/core/src/test/java/org/apache/struts2/interceptor/StrutsConversionErrorInterceptorTest.java @@ -60,7 +60,7 @@ public class StrutsConversionErrorInterceptorTest extends StrutsInternalTestCase assertNull(action.getFieldErrors().get("foo")); assertNull(action.getFieldErrors().get("bar")); assertNull(action.getFieldErrors().get("baz")); -interceptor.intercept(invocation); +interceptor.doIntercept(invocation); assertTrue(action.hasFieldErrors()); assertNotNull(action.getFieldErrors().get("foo")); assertNull(action.getFieldErrors().get("bar")); @@ -75,7 +75,7 @@ public class StrutsConversionErrorInterceptorTest extends StrutsInternalTestCase stack.push(action); mockInvocation.matchAndReturn("getAction",action); assertNull(action.getFieldErrors().get("foo")); -interceptor.intercept(invocation); +interceptor.doIntercept(invocation); assertTrue(action.hasFieldErrors()); assertNotNull(action.getFieldErrors().get("foo")); }
[4/5] struts git commit: ConversionErrorInterceptor to extend MethodFilterIntercept
ConversionErrorInterceptor to extend MethodFilterIntercept See WW-4676 Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/6b229018 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/6b229018 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/6b229018 Branch: refs/heads/master Commit: 6b22901814e38cdcc7be53c7c36bdc18ae0706bf Parents: d9fe140 Author: gregh3269 Authored: Thu Aug 4 09:49:44 2016 +0100 Committer: Lukasz Lenart Committed: Wed Sep 28 10:36:39 2016 +0200 -- .../xwork2/interceptor/ConversionErrorInterceptorTest.java | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/struts/blob/6b229018/core/src/test/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptorTest.java -- diff --git a/core/src/test/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptorTest.java b/core/src/test/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptorTest.java index 0e34ae1..33adf7e 100644 --- a/core/src/test/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptorTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptorTest.java @@ -48,7 +48,7 @@ public class ConversionErrorInterceptorTest extends XWorkTestCase { stack.push(action); mockInvocation.matchAndReturn("getAction", action); assertNull(action.getFieldErrors().get("foo")); -interceptor.intercept(invocation); +interceptor.doIntercept(invocation); assertTrue(action.hasFieldErrors()); assertNotNull(action.getFieldErrors().get("foo")); } @@ -61,7 +61,7 @@ public class ConversionErrorInterceptorTest extends XWorkTestCase { stack.push(action); mockInvocation.matchAndReturn("getAction", action); assertNull(action.getFieldErrors().get(fieldName)); -interceptor.intercept(invocation); +interceptor.doIntercept(invocation); assertTrue(action.hasFieldErrors()); // This fails! assertNotNull(action.getFieldErrors().get(fieldName)); } @@ -76,7 +76,7 @@ public class ConversionErrorInterceptorTest extends XWorkTestCase { assertNull(action.getFieldErrors().get("foo")); assertEquals(55, stack.findValue("foo")); -interceptor.intercept(mai); +interceptor.doIntercept(mai); assertTrue(action.hasFieldErrors()); assertNotNull(action.getFieldErrors().get("foo")); @@ -100,7 +100,7 @@ public class ConversionErrorInterceptorTest extends XWorkTestCase { assertNull(action.getFieldErrors().get("foo")); assertEquals(55, stack.findValue("foo")); -interceptor.intercept(mai); +interceptor.doIntercept(mai); assertTrue(action.hasFieldErrors()); assertNotNull(action.getFieldErrors().get("foo"));
[3/7] struts git commit: Merge remote-tracking branch 'upstream/master'
Merge remote-tracking branch 'upstream/master' Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/b6be359b Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/b6be359b Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/b6be359b Branch: refs/heads/master Commit: b6be359b0ea8461d8efcd681e3e2932e253194e3 Parents: 50fa265 ef9c661 Author: gregh3269 Authored: Thu Aug 4 08:47:22 2016 +0100 Committer: gregh3269 Committed: Thu Aug 4 08:47:22 2016 +0100 -- .../org/apache/struts2/util/URLDecoderUtil.java | 12 .../struts2/views/util/DefaultUrlHelper.java| 27 +--- .../apache/struts2/util/URLDecoderUtilTest.java | 7 ++ .../views/util/DefaultUrlHelperTest.java| 71 +--- 4 files changed, 53 insertions(+), 64 deletions(-) --
[1/7] struts git commit: ConversionErrorInterceptor to extend MethodFilterIntercept. See WW-4676
Repository: struts Updated Branches: refs/heads/master 6c2ff6f15 -> 9ee5c4e6e ConversionErrorInterceptor to extend MethodFilterIntercept. See WW-4676 Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/5e07b957 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/5e07b957 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/5e07b957 Branch: refs/heads/master Commit: 5e07b9574c66110b9a44338c6c7290a65be276f3 Parents: 7fdc103 Author: gregh3269 Authored: Wed Aug 3 10:50:44 2016 +0100 Committer: gregh3269 Committed: Wed Aug 3 10:50:44 2016 +0100 -- .../xwork2/interceptor/ConversionErrorInterceptor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/struts/blob/5e07b957/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java -- diff --git a/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java b/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java index 6a82e04..f7234e7 100644 --- a/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java +++ b/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java @@ -75,7 +75,7 @@ import java.util.Map; * * @author Jason Carreira */ -public class ConversionErrorInterceptor extends AbstractInterceptor { +public class ConversionErrorInterceptor extends MethodFilterInterceptor { public static final String ORIGINAL_PROPERTY_OVERRIDE = "original.property.override"; @@ -88,7 +88,7 @@ public class ConversionErrorInterceptor extends AbstractInterceptor { } @Override -public String intercept(ActionInvocation invocation) throws Exception { +public String doIntercept(ActionInvocation invocation) throws Exception { ActionContext invocationContext = invocation.getInvocationContext(); Map conversionErrors = invocationContext.getConversionErrors();
[5/7] struts git commit: ConversionErrorInterceptor to extend MethodFilterIntercept
ConversionErrorInterceptor to extend MethodFilterIntercept See WW-4676 Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/607fd00a Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/607fd00a Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/607fd00a Branch: refs/heads/master Commit: 607fd00af00fb9a677dc69fdebcc42efedea735d Parents: 51a4920 Author: gregh3269 Authored: Thu Aug 4 09:49:44 2016 +0100 Committer: gregh3269 Committed: Thu Aug 4 09:49:44 2016 +0100 -- .../xwork2/interceptor/ConversionErrorInterceptorTest.java | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/struts/blob/607fd00a/core/src/test/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptorTest.java -- diff --git a/core/src/test/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptorTest.java b/core/src/test/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptorTest.java index 0e34ae1..33adf7e 100644 --- a/core/src/test/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptorTest.java +++ b/core/src/test/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptorTest.java @@ -48,7 +48,7 @@ public class ConversionErrorInterceptorTest extends XWorkTestCase { stack.push(action); mockInvocation.matchAndReturn("getAction", action); assertNull(action.getFieldErrors().get("foo")); -interceptor.intercept(invocation); +interceptor.doIntercept(invocation); assertTrue(action.hasFieldErrors()); assertNotNull(action.getFieldErrors().get("foo")); } @@ -61,7 +61,7 @@ public class ConversionErrorInterceptorTest extends XWorkTestCase { stack.push(action); mockInvocation.matchAndReturn("getAction", action); assertNull(action.getFieldErrors().get(fieldName)); -interceptor.intercept(invocation); +interceptor.doIntercept(invocation); assertTrue(action.hasFieldErrors()); // This fails! assertNotNull(action.getFieldErrors().get(fieldName)); } @@ -76,7 +76,7 @@ public class ConversionErrorInterceptorTest extends XWorkTestCase { assertNull(action.getFieldErrors().get("foo")); assertEquals(55, stack.findValue("foo")); -interceptor.intercept(mai); +interceptor.doIntercept(mai); assertTrue(action.hasFieldErrors()); assertNotNull(action.getFieldErrors().get("foo")); @@ -100,7 +100,7 @@ public class ConversionErrorInterceptorTest extends XWorkTestCase { assertNull(action.getFieldErrors().get("foo")); assertEquals(55, stack.findValue("foo")); -interceptor.intercept(mai); +interceptor.doIntercept(mai); assertTrue(action.hasFieldErrors()); assertNotNull(action.getFieldErrors().get("foo"));
[2/7] struts git commit: Add java doc for MethodFilterInterceptor
Add java doc for MethodFilterInterceptor Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/50fa2653 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/50fa2653 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/50fa2653 Branch: refs/heads/master Commit: 50fa26533a43295e70db7eca6f4f7d8c69e0d2fe Parents: 5e07b95 Author: gregh3269 Authored: Thu Aug 4 08:31:32 2016 +0100 Committer: gregh3269 Committed: Thu Aug 4 08:31:32 2016 +0100 -- .../xwork2/interceptor/ConversionErrorInterceptor.java | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/struts/blob/50fa2653/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java -- diff --git a/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java b/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java index f7234e7..67fc1ad 100644 --- a/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java +++ b/core/src/main/java/com/opensymphony/xwork2/interceptor/ConversionErrorInterceptor.java @@ -37,7 +37,13 @@ import java.util.Map; * display the original string ("abc") again rather than the int value (likely 0, which would make very little sense to * the user). * - * + * + * + * Note: Since 2.5.2, this interceptor extends {@link MethodFilterInterceptor}, therefore being + * able to deal with excludeMethods / includeMethods parameters. See [Workflow Interceptor] + * (class {@link DefaultWorkflowInterceptor}) for documentation and examples on how to use this feature. + * + * * * * Interceptor parameters:
[6/7] struts git commit: Fixes failing test
Fixes failing test Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/cf676d92 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/cf676d92 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/cf676d92 Branch: refs/heads/master Commit: cf676d9244a456180d35f89a044d634dd37d Parents: 607fd00 Author: Lukasz Lenart Authored: Wed Sep 28 10:35:06 2016 +0200 Committer: Lukasz Lenart Committed: Wed Sep 28 10:35:06 2016 +0200 -- .../interceptor/StrutsConversionErrorInterceptorTest.java| 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/struts/blob/cf676d92/core/src/test/java/org/apache/struts2/interceptor/StrutsConversionErrorInterceptorTest.java -- diff --git a/core/src/test/java/org/apache/struts2/interceptor/StrutsConversionErrorInterceptorTest.java b/core/src/test/java/org/apache/struts2/interceptor/StrutsConversionErrorInterceptorTest.java index b7d1016..fdf4c59 100644 --- a/core/src/test/java/org/apache/struts2/interceptor/StrutsConversionErrorInterceptorTest.java +++ b/core/src/test/java/org/apache/struts2/interceptor/StrutsConversionErrorInterceptorTest.java @@ -60,7 +60,7 @@ public class StrutsConversionErrorInterceptorTest extends StrutsInternalTestCase assertNull(action.getFieldErrors().get("foo")); assertNull(action.getFieldErrors().get("bar")); assertNull(action.getFieldErrors().get("baz")); -interceptor.intercept(invocation); +interceptor.doIntercept(invocation); assertTrue(action.hasFieldErrors()); assertNotNull(action.getFieldErrors().get("foo")); assertNull(action.getFieldErrors().get("bar")); @@ -75,7 +75,7 @@ public class StrutsConversionErrorInterceptorTest extends StrutsInternalTestCase stack.push(action); mockInvocation.matchAndReturn("getAction",action); assertNull(action.getFieldErrors().get("foo")); -interceptor.intercept(invocation); +interceptor.doIntercept(invocation); assertTrue(action.hasFieldErrors()); assertNotNull(action.getFieldErrors().get("foo")); }
[7/7] struts git commit: WW-4676 Extends ConversionErrorInterceptor with MethodFilterInterceptor
WW-4676 Extends ConversionErrorInterceptor with MethodFilterInterceptor Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/9ee5c4e6 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/9ee5c4e6 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/9ee5c4e6 Branch: refs/heads/master Commit: 9ee5c4e6efb69898fa4cd6745ca40a36cc53c690 Parents: 6c2ff6f cf676d9 Author: Lukasz Lenart Authored: Wed Sep 28 10:37:27 2016 +0200 Committer: Lukasz Lenart Committed: Wed Sep 28 10:37:27 2016 +0200 -- --
[4/7] struts git commit: Revert "WW-4628: proper decoding of parameters in query-string"
Revert "WW-4628: proper decoding of parameters in query-string" This reverts commit ef9c66118ede16f3ff239ea864641d5bdadeecae. Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/51a49201 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/51a49201 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/51a49201 Branch: refs/heads/master Commit: 51a49201adf73e33ba68d533f3535a32f507b531 Parents: b6be359 Author: gregh3269 Authored: Thu Aug 4 08:57:25 2016 +0100 Committer: gregh3269 Committed: Thu Aug 4 08:57:25 2016 +0100 -- .../org/apache/struts2/util/URLDecoderUtil.java | 12 .../struts2/views/util/DefaultUrlHelper.java| 27 +++- .../apache/struts2/util/URLDecoderUtilTest.java | 7 -- .../views/util/DefaultUrlHelperTest.java| 71 +++- 4 files changed, 64 insertions(+), 53 deletions(-) -- http://git-wip-us.apache.org/repos/asf/struts/blob/51a49201/core/src/main/java/org/apache/struts2/util/URLDecoderUtil.java -- diff --git a/core/src/main/java/org/apache/struts2/util/URLDecoderUtil.java b/core/src/main/java/org/apache/struts2/util/URLDecoderUtil.java index 3c61d1e..10f2a78 100644 --- a/core/src/main/java/org/apache/struts2/util/URLDecoderUtil.java +++ b/core/src/main/java/org/apache/struts2/util/URLDecoderUtil.java @@ -19,16 +19,4 @@ public class URLDecoderUtil { return UDecoder.URLDecode(sequence, charset); } -/** - * Decodes a x-www-form-urlencoded string. - * @param sequence the String to decode - * @param charset The name of a supported character encoding. - * @param isQueryString whether input is a query string. If true other decoding rules apply. - * @return the newly decoded String - * @exception IllegalArgumentException If the encoding is not valid - */ -public static String decode(String sequence, String charset, boolean isQueryString) { -return UDecoder.URLDecode(sequence, charset, isQueryString); -} - } http://git-wip-us.apache.org/repos/asf/struts/blob/51a49201/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java -- diff --git a/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java b/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java index 668d1a9..16739af 100644 --- a/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java +++ b/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java @@ -284,25 +284,14 @@ public class DefaultUrlHelper implements UrlHelper { * @return the encoded string */ public String decode( String input ) { -return URLDecoderUtil.decode(input, encoding, false); + try { +return URLDecoderUtil.decode(input, encoding); + } catch (Exception e) { + LOG.warn("Could not decode URL parameter '{}', returning value un-decoded", input); + return input; + } } -/** - * Decodes the URL using {@link URLDecoderUtil#decode(String, String, boolean)} with the encoding specified in the configuration. - * - * @param input the input to decode - * @param isQueryString whether input is a query string. If true other decoding rules apply. - * @return the encoded string - */ -public String decode( String input, boolean isQueryString ) { -try { -return URLDecoderUtil.decode(input, encoding, isQueryString); -} catch (Exception e) { -LOG.warn("Could not decode URL parameter '{}', returning value un-decoded", input); -return input; -} -} - public Map parseQueryString(String queryString, boolean forceValueArray) { Map queryParams = new LinkedHashMap(); if (queryString != null) { @@ -319,8 +308,8 @@ public class DefaultUrlHelper implements UrlHelper { paramValue = tmpParams[1]; } if (paramName != null) { -paramName = decode(paramName, true); -String translatedParamValue = decode(paramValue, true); +paramName = decode(paramName); +String translatedParamValue = decode(paramValue); if (queryParams.containsKey(paramName) || forceValueArray) { // WW-1619 append new param value to existing value(s) http://git-wip-us.apache.org/repos/asf/struts/blob/51a49201/core/src/test/java/org/apache/struts2/util/URLDecoderUtilTest.java -- diff --git a/c
struts git commit: Fixes issues in config-browse plugin
Repository: struts Updated Branches: refs/heads/master 9ee5c4e6e -> 50328ffe1 Fixes issues in config-browse plugin Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/50328ffe Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/50328ffe Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/50328ffe Branch: refs/heads/master Commit: 50328ffe1a4705386dab9ee2205b33aea44aeab5 Parents: 9ee5c4e Author: Lukasz Lenart Authored: Wed Sep 28 11:32:14 2016 +0200 Committer: Lukasz Lenart Committed: Wed Sep 28 11:32:14 2016 +0200 -- .../java/org/apache/struts2/config_browser/ShowBeansAction.java | 1 + .../org/apache/struts2/config_browser/ShowConstantsAction.java | 1 + .../src/main/resources/config-browser/actionNames.ftl| 2 +- .../src/main/resources/config-browser/showConfig.ftl | 4 ++-- .../src/main/resources/config-browser/validatorDetails.ftl | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/struts/blob/50328ffe/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowBeansAction.java -- diff --git a/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowBeansAction.java b/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowBeansAction.java index debc17c..8ad85c9 100644 --- a/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowBeansAction.java +++ b/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowBeansAction.java @@ -50,6 +50,7 @@ public class ShowBeansAction extends ActionNamesAction { @Inject public void setContainer(Container container) { +super.setContainer(container); bindings = new TreeMap>(); bindings.put(ObjectFactory.class.getName(), addBindings(container, ObjectFactory.class, StrutsConstants.STRUTS_OBJECTFACTORY)); bindings.put(XWorkConverter.class.getName(), addBindings(container, XWorkConverter.class, StrutsConstants.STRUTS_XWORKCONVERTER)); http://git-wip-us.apache.org/repos/asf/struts/blob/50328ffe/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowConstantsAction.java -- diff --git a/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowConstantsAction.java b/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowConstantsAction.java index cf292e0..3b05645 100644 --- a/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowConstantsAction.java +++ b/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowConstantsAction.java @@ -36,6 +36,7 @@ public class ShowConstantsAction extends ActionNamesAction { @Inject public void setContainer(Container container) { +super.setContainer(container); constants = new HashMap(); for (String key : container.getInstanceNames(String.class)) { constants.put(key, container.getInstance(String.class, key)); http://git-wip-us.apache.org/repos/asf/struts/blob/50328ffe/plugins/config-browser/src/main/resources/config-browser/actionNames.ftl -- diff --git a/plugins/config-browser/src/main/resources/config-browser/actionNames.ftl b/plugins/config-browser/src/main/resources/config-browser/actionNames.ftl index 9721afd..d850028 100644 --- a/plugins/config-browser/src/main/resources/config-browser/actionNames.ftl +++ b/plugins/config-browser/src/main/resources/config-browser/actionNames.ftl @@ -22,7 +22,7 @@ --> <#include "tigris-macros.ftl"> <@startPage pageTitle="Actions in namespace"/> -Actions in <#if namespace == ""> default namespace <#else> ${namespace} +Actions in <#if namespace == ""> default namespace <#else> ${namespace?html} http://git-wip-us.apache.org/repos/asf/struts/blob/50328ffe/plugins/config-browser/src/main/resources/config-browser/showConfig.ftl -- diff --git a/plugins/config-browser/src/main/resources/config-browser/showConfig.ftl b/plugins/config-browser/src/main/resources/config-browser/showConfig.ftl index 42e0934..d140fca 100644 --- a/plugins/config-browser/src/main/resources/config-browser/showConfig.ftl +++ b/plugins/config-browser/src/main/resources/config-browser/showConfig.ftl @@ -42,8 +42,8 @@ <@s.url var="url" action="showConfig" includeParams="none"> -<@s.param name="namespace">${namespace} -<@s.param name="actionName">${actionName} +<@s.param name="namespace">${namespace?html} +<@s.param name
struts git commit: Fixes issues in config-browse plugin
Repository: struts Updated Branches: refs/heads/support-2-3 b348fc552 -> ba0563183 Fixes issues in config-browse plugin Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/ba056318 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/ba056318 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/ba056318 Branch: refs/heads/support-2-3 Commit: ba0563183b128dcef88b469f46e528a12e0179e7 Parents: b348fc5 Author: Lukasz Lenart Authored: Wed Sep 28 11:32:14 2016 +0200 Committer: Lukasz Lenart Committed: Wed Sep 28 11:42:24 2016 +0200 -- .../org/apache/struts2/config_browser/ShowBeansAction.java | 1 + .../apache/struts2/config_browser/ShowConstantsAction.java | 1 + .../src/main/resources/config-browser/actionNames.ftl| 2 +- .../src/main/resources/config-browser/showConfig.ftl | 8 .../src/main/resources/config-browser/validatorDetails.ftl | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/struts/blob/ba056318/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowBeansAction.java -- diff --git a/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowBeansAction.java b/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowBeansAction.java index debc17c..8ad85c9 100644 --- a/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowBeansAction.java +++ b/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowBeansAction.java @@ -50,6 +50,7 @@ public class ShowBeansAction extends ActionNamesAction { @Inject public void setContainer(Container container) { +super.setContainer(container); bindings = new TreeMap>(); bindings.put(ObjectFactory.class.getName(), addBindings(container, ObjectFactory.class, StrutsConstants.STRUTS_OBJECTFACTORY)); bindings.put(XWorkConverter.class.getName(), addBindings(container, XWorkConverter.class, StrutsConstants.STRUTS_XWORKCONVERTER)); http://git-wip-us.apache.org/repos/asf/struts/blob/ba056318/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowConstantsAction.java -- diff --git a/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowConstantsAction.java b/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowConstantsAction.java index cf292e0..3b05645 100644 --- a/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowConstantsAction.java +++ b/plugins/config-browser/src/main/java/org/apache/struts2/config_browser/ShowConstantsAction.java @@ -36,6 +36,7 @@ public class ShowConstantsAction extends ActionNamesAction { @Inject public void setContainer(Container container) { +super.setContainer(container); constants = new HashMap(); for (String key : container.getInstanceNames(String.class)) { constants.put(key, container.getInstance(String.class, key)); http://git-wip-us.apache.org/repos/asf/struts/blob/ba056318/plugins/config-browser/src/main/resources/config-browser/actionNames.ftl -- diff --git a/plugins/config-browser/src/main/resources/config-browser/actionNames.ftl b/plugins/config-browser/src/main/resources/config-browser/actionNames.ftl index d7e8651..30d73c5 100644 --- a/plugins/config-browser/src/main/resources/config-browser/actionNames.ftl +++ b/plugins/config-browser/src/main/resources/config-browser/actionNames.ftl @@ -22,7 +22,7 @@ --> <#include "tigris-macros.ftl"> <@startPage pageTitle="Actions in namespace"/> -Actions in <#if namespace == ""> default namespace <#else> ${namespace} +Actions in <#if namespace == ""> default namespace <#else> ${namespace?html} http://git-wip-us.apache.org/repos/asf/struts/blob/ba056318/plugins/config-browser/src/main/resources/config-browser/showConfig.ftl -- diff --git a/plugins/config-browser/src/main/resources/config-browser/showConfig.ftl b/plugins/config-browser/src/main/resources/config-browser/showConfig.ftl index 34987a1..d140fca 100644 --- a/plugins/config-browser/src/main/resources/config-browser/showConfig.ftl +++ b/plugins/config-browser/src/main/resources/config-browser/showConfig.ftl @@ -29,7 +29,7 @@ Action name:${actionName} Namespace: ${namespace} Action class: ${config.className} - Action method: <#if config.methodName?exists>${config.methodName} + Action method: <#if config.methodName??>
struts git commit: WW-4628: proper decoding of parameters in query-string
Repository: struts Updated Branches: refs/heads/master 50328ffe1 -> 9b38ad8fc WW-4628: proper decoding of parameters in query-string Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/9b38ad8f Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/9b38ad8f Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/9b38ad8f Branch: refs/heads/master Commit: 9b38ad8fcf20bdbdb6baacd5812bcf196d80ea07 Parents: 50328ff Author: cnenning Authored: Wed Aug 3 13:02:16 2016 +0200 Committer: cnenning Committed: Wed Sep 28 13:09:40 2016 +0200 -- .../org/apache/struts2/util/URLDecoderUtil.java | 12 .../struts2/views/util/DefaultUrlHelper.java| 27 +--- .../apache/struts2/util/URLDecoderUtilTest.java | 7 ++ .../views/util/DefaultUrlHelperTest.java| 71 +--- 4 files changed, 53 insertions(+), 64 deletions(-) -- http://git-wip-us.apache.org/repos/asf/struts/blob/9b38ad8f/core/src/main/java/org/apache/struts2/util/URLDecoderUtil.java -- diff --git a/core/src/main/java/org/apache/struts2/util/URLDecoderUtil.java b/core/src/main/java/org/apache/struts2/util/URLDecoderUtil.java index 10f2a78..3c61d1e 100644 --- a/core/src/main/java/org/apache/struts2/util/URLDecoderUtil.java +++ b/core/src/main/java/org/apache/struts2/util/URLDecoderUtil.java @@ -19,4 +19,16 @@ public class URLDecoderUtil { return UDecoder.URLDecode(sequence, charset); } +/** + * Decodes a x-www-form-urlencoded string. + * @param sequence the String to decode + * @param charset The name of a supported character encoding. + * @param isQueryString whether input is a query string. If true other decoding rules apply. + * @return the newly decoded String + * @exception IllegalArgumentException If the encoding is not valid + */ +public static String decode(String sequence, String charset, boolean isQueryString) { +return UDecoder.URLDecode(sequence, charset, isQueryString); +} + } http://git-wip-us.apache.org/repos/asf/struts/blob/9b38ad8f/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java -- diff --git a/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java b/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java index 16739af..668d1a9 100644 --- a/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java +++ b/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java @@ -284,14 +284,25 @@ public class DefaultUrlHelper implements UrlHelper { * @return the encoded string */ public String decode( String input ) { - try { -return URLDecoderUtil.decode(input, encoding); - } catch (Exception e) { - LOG.warn("Could not decode URL parameter '{}', returning value un-decoded", input); - return input; - } +return URLDecoderUtil.decode(input, encoding, false); } +/** + * Decodes the URL using {@link URLDecoderUtil#decode(String, String, boolean)} with the encoding specified in the configuration. + * + * @param input the input to decode + * @param isQueryString whether input is a query string. If true other decoding rules apply. + * @return the encoded string + */ +public String decode( String input, boolean isQueryString ) { +try { +return URLDecoderUtil.decode(input, encoding, isQueryString); +} catch (Exception e) { +LOG.warn("Could not decode URL parameter '{}', returning value un-decoded", input); +return input; +} +} + public Map parseQueryString(String queryString, boolean forceValueArray) { Map queryParams = new LinkedHashMap(); if (queryString != null) { @@ -308,8 +319,8 @@ public class DefaultUrlHelper implements UrlHelper { paramValue = tmpParams[1]; } if (paramName != null) { -paramName = decode(paramName); -String translatedParamValue = decode(paramValue); +paramName = decode(paramName, true); +String translatedParamValue = decode(paramValue, true); if (queryParams.containsKey(paramName) || forceValueArray) { // WW-1619 append new param value to existing value(s) http://git-wip-us.apache.org/repos/asf/struts/blob/9b38ad8f/core/src/test/java/org/apache/struts2/util/URLDecoderUtilTest.java -- diff