[1/2] struts git commit: WW-4507 - clone Tomcat UDecoder and use it for in query string handling
Repository: struts Updated Branches: refs/heads/support-2-3 c6750c110 -> 5421930b4 http://git-wip-us.apache.org/repos/asf/struts/blob/5421930b/core/src/main/java/org/apache/struts2/util/tomcat/buf/MessageBytes.java -- diff --git a/core/src/main/java/org/apache/struts2/util/tomcat/buf/MessageBytes.java b/core/src/main/java/org/apache/struts2/util/tomcat/buf/MessageBytes.java new file mode 100644 index 000..df07284 --- /dev/null +++ b/core/src/main/java/org/apache/struts2/util/tomcat/buf/MessageBytes.java @@ -0,0 +1,546 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.struts2.util.tomcat.buf; + +import java.io.IOException; +import java.io.Serializable; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.util.Locale; + +/** + * This class is used to represent a subarray of bytes in an HTTP message. + * It represents all request/response elements. The byte/char conversions are + * delayed and cached. Everything is recyclable. + * + * The object can represent a byte[], a char[], or a (sub) String. All + * operations can be made in case sensitive mode or not. + * + * @author d...@eng.sun.com + * @author James Todd [go...@eng.sun.com] + * @author Costin Manolache + */ +public final class MessageBytes implements Cloneable, Serializable { +private static final long serialVersionUID = 1L; + +// primary type ( whatever is set as original value ) +private int type = T_NULL; + +public static final int T_NULL = 0; +/** getType() is T_STR if the the object used to create the MessageBytes +was a String */ +public static final int T_STR = 1; +/** getType() is T_STR if the the object used to create the MessageBytes +was a byte[] */ +public static final int T_BYTES = 2; +/** getType() is T_STR if the the object used to create the MessageBytes +was a char[] */ +public static final int T_CHARS = 3; + +private int hashCode=0; +// did we compute the hashcode ? +private boolean hasHashCode=false; + +// Internal objects to represent array + offset, and specific methods +private final ByteChunk byteC=new ByteChunk(); +private final CharChunk charC=new CharChunk(); + +// String +private String strValue; +// true if a String value was computed. Probably not needed, +// strValue!=null is the same +private boolean hasStrValue=false; + +/** + * Creates a new, uninitialized MessageBytes object. + * Use static newInstance() in order to allow + * future hooks. + */ +private MessageBytes() { +} + +/** Construct a new MessageBytes instance + */ +public static MessageBytes newInstance() { +return factory.newInstance(); +} + +public boolean isNull() { +// should we check also hasStrValue ??? +return byteC.isNull() && charC.isNull() && ! hasStrValue; +// bytes==null && strValue==null; +} + +/** + * Resets the message bytes to an uninitialized (NULL) state. + */ +public void recycle() { +type=T_NULL; +byteC.recycle(); +charC.recycle(); + +strValue=null; + +hasStrValue=false; +hasHashCode=false; +hasLongValue=false; +} + + +/** + * Sets the content to the specified subarray of bytes. + * + * @param b the bytes + * @param off the start offset of the bytes + * @param len the length of the bytes + */ +public void setBytes(byte[] b, int off, int len) { +byteC.setBytes( b, off, len ); +type=T_BYTES; +hasStrValue=false; +hasHashCode=false; +hasLongValue=false; +} + +/** + * Sets the content to be a char[] + * + * @param c the bytes + * @param off the start offset of the bytes + * @param len the length of the bytes + */ +public void setChars( char[] c, int off, int len ) { +charC.setChars( c, off, len ); +type=T_CHARS; +hasStrValue=false; +hasHashCode=false; +hasLongValue=false; +} + +/** + * Set the content to be a string + */ +publi
[2/2] struts git commit: WW-4507 - clone Tomcat UDecoder and use it for in query string handling
WW-4507 - clone Tomcat UDecoder and use it for in query string handling Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/5421930b Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/5421930b Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/5421930b Branch: refs/heads/support-2-3 Commit: 5421930b49822606792f36653b17d3d95ef106f9 Parents: c6750c1 Author: Rene Gielen Authored: Thu Jan 14 14:52:03 2016 +0100 Committer: Rene Gielen Committed: Thu Jan 14 14:52:03 2016 +0100 -- .../dispatcher/mapper/Restful2ActionMapper.java | 6 +- .../dispatcher/mapper/RestfulActionMapper.java | 6 +- .../org/apache/struts2/util/URLDecoderUtil.java | 22 + .../apache/struts2/util/tomcat/buf/Ascii.java | 255 + .../struts2/util/tomcat/buf/B2CConverter.java | 201 .../struts2/util/tomcat/buf/ByteChunk.java | 935 +++ .../struts2/util/tomcat/buf/CharChunk.java | 700 ++ .../struts2/util/tomcat/buf/HexUtils.java | 113 +++ .../struts2/util/tomcat/buf/MessageBytes.java | 546 +++ .../struts2/util/tomcat/buf/StringCache.java| 695 ++ .../struts2/util/tomcat/buf/UDecoder.java | 421 + .../struts2/util/tomcat/buf/Utf8Decoder.java| 293 ++ .../struts2/views/util/DefaultUrlHelper.java| 8 +- .../apache/struts2/util/URLDecoderUtilTest.java | 71 ++ 14 files changed, 4262 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/struts/blob/5421930b/core/src/main/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.java -- diff --git a/core/src/main/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.java b/core/src/main/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.java index 3f08e84..0d93711 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.java @@ -26,9 +26,9 @@ import com.opensymphony.xwork2.inject.Inject; import com.opensymphony.xwork2.util.logging.Logger; import com.opensymphony.xwork2.util.logging.LoggerFactory; import org.apache.struts2.StrutsConstants; +import org.apache.struts2.util.URLDecoderUtil; import javax.servlet.http.HttpServletRequest; -import java.net.URLDecoder; import java.util.HashMap; import java.util.StringTokenizer; @@ -133,10 +133,10 @@ public class Restful2ActionMapper extends DefaultActionMapper { while (st.hasMoreTokens()) { if (isNameTok) { -paramName = URLDecoder.decode(st.nextToken(), "UTF-8"); +paramName = URLDecoderUtil.decode(st.nextToken(), "UTF-8"); isNameTok = false; } else { -paramValue = URLDecoder.decode(st.nextToken(), "UTF-8"); +paramValue = URLDecoderUtil.decode(st.nextToken(), "UTF-8"); if ((paramName != null) && (paramName.length() > 0)) { parameters.put(paramName, paramValue); http://git-wip-us.apache.org/repos/asf/struts/blob/5421930b/core/src/main/java/org/apache/struts2/dispatcher/mapper/RestfulActionMapper.java -- diff --git a/core/src/main/java/org/apache/struts2/dispatcher/mapper/RestfulActionMapper.java b/core/src/main/java/org/apache/struts2/dispatcher/mapper/RestfulActionMapper.java index b2378f4..4b98409 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/mapper/RestfulActionMapper.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/mapper/RestfulActionMapper.java @@ -25,9 +25,9 @@ import com.opensymphony.xwork2.config.ConfigurationManager; import com.opensymphony.xwork2.util.logging.Logger; import com.opensymphony.xwork2.util.logging.LoggerFactory; import org.apache.struts2.RequestUtils; +import org.apache.struts2.util.URLDecoderUtil; import javax.servlet.http.HttpServletRequest; -import java.net.URLDecoder; import java.util.HashMap; import java.util.Map; import java.util.StringTokenizer; @@ -67,10 +67,10 @@ public class RestfulActionMapper implements ActionMapper { while (st.hasMoreTokens()) { if (isNameTok) { -paramName = URLDecoder.decode(st.nextToken(), "UTF-8"); +paramName = URLDecoderUtil.decode(st.nextToken(), "UTF-8"); isNameTok = false; } else { -paramValue = URLDecoder.decode(st.nextToken(), "UTF-8"); +paramValue = URLDecoderUtil.decode(st.nextToken
[2/2] struts git commit: WW-4507 - clone Tomcat UDecoder and use it for in query string handling (cherry picked from commit 5421930)
WW-4507 - clone Tomcat UDecoder and use it for in query string handling (cherry picked from commit 5421930) Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/72471d70 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/72471d70 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/72471d70 Branch: refs/heads/master Commit: 72471d7075681bea52046645ad7aa34e9c53751e Parents: 460faa3 Author: Rene Gielen Authored: Thu Jan 14 14:52:03 2016 +0100 Committer: Rene Gielen Committed: Thu Jan 14 15:04:38 2016 +0100 -- .../dispatcher/mapper/Restful2ActionMapper.java | 6 +- .../dispatcher/mapper/RestfulActionMapper.java | 6 +- .../org/apache/struts2/util/URLDecoderUtil.java | 22 + .../apache/struts2/util/tomcat/buf/Ascii.java | 255 + .../struts2/util/tomcat/buf/B2CConverter.java | 201 .../struts2/util/tomcat/buf/ByteChunk.java | 935 +++ .../struts2/util/tomcat/buf/CharChunk.java | 700 ++ .../struts2/util/tomcat/buf/HexUtils.java | 113 +++ .../struts2/util/tomcat/buf/MessageBytes.java | 546 +++ .../struts2/util/tomcat/buf/StringCache.java| 695 ++ .../struts2/util/tomcat/buf/UDecoder.java | 421 + .../struts2/util/tomcat/buf/Utf8Decoder.java| 293 ++ .../struts2/views/util/DefaultUrlHelper.java| 7 +- .../apache/struts2/util/URLDecoderUtilTest.java | 71 ++ 14 files changed, 4262 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/struts/blob/72471d70/core/src/main/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.java -- diff --git a/core/src/main/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.java b/core/src/main/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.java index b474913..c2a9bfc 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapper.java @@ -27,9 +27,9 @@ import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.struts2.StrutsConstants; +import org.apache.struts2.util.URLDecoderUtil; import javax.servlet.http.HttpServletRequest; -import java.net.URLDecoder; import java.util.HashMap; import java.util.StringTokenizer; @@ -132,10 +132,10 @@ public class Restful2ActionMapper extends DefaultActionMapper { while (st.hasMoreTokens()) { if (isNameTok) { -paramName = URLDecoder.decode(st.nextToken(), "UTF-8"); +paramName = URLDecoderUtil.decode(st.nextToken(), "UTF-8"); isNameTok = false; } else { -paramValue = URLDecoder.decode(st.nextToken(), "UTF-8"); +paramValue = URLDecoderUtil.decode(st.nextToken(), "UTF-8"); if ((paramName != null) && (paramName.length() > 0)) { parameters.put(paramName, paramValue); http://git-wip-us.apache.org/repos/asf/struts/blob/72471d70/core/src/main/java/org/apache/struts2/dispatcher/mapper/RestfulActionMapper.java -- diff --git a/core/src/main/java/org/apache/struts2/dispatcher/mapper/RestfulActionMapper.java b/core/src/main/java/org/apache/struts2/dispatcher/mapper/RestfulActionMapper.java index d7ae2c0..9db58e3 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/mapper/RestfulActionMapper.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/mapper/RestfulActionMapper.java @@ -25,9 +25,9 @@ import com.opensymphony.xwork2.config.ConfigurationManager; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.struts2.RequestUtils; +import org.apache.struts2.util.URLDecoderUtil; import javax.servlet.http.HttpServletRequest; -import java.net.URLDecoder; import java.util.HashMap; import java.util.Map; import java.util.StringTokenizer; @@ -67,10 +67,10 @@ public class RestfulActionMapper implements ActionMapper { while (st.hasMoreTokens()) { if (isNameTok) { -paramName = URLDecoder.decode(st.nextToken(), "UTF-8"); +paramName = URLDecoderUtil.decode(st.nextToken(), "UTF-8"); isNameTok = false; } else { -paramValue = URLDecoder.decode(st.nextToken(), "UTF-8"); +paramValue = URLDecoderUtil.decode(st.nextToken(), "UTF-8");
[1/2] struts git commit: WW-4507 - clone Tomcat UDecoder and use it for in query string handling (cherry picked from commit 5421930)
Repository: struts Updated Branches: refs/heads/master 460faa33d -> 72471d707 http://git-wip-us.apache.org/repos/asf/struts/blob/72471d70/core/src/main/java/org/apache/struts2/util/tomcat/buf/MessageBytes.java -- diff --git a/core/src/main/java/org/apache/struts2/util/tomcat/buf/MessageBytes.java b/core/src/main/java/org/apache/struts2/util/tomcat/buf/MessageBytes.java new file mode 100644 index 000..df07284 --- /dev/null +++ b/core/src/main/java/org/apache/struts2/util/tomcat/buf/MessageBytes.java @@ -0,0 +1,546 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.struts2.util.tomcat.buf; + +import java.io.IOException; +import java.io.Serializable; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.util.Locale; + +/** + * This class is used to represent a subarray of bytes in an HTTP message. + * It represents all request/response elements. The byte/char conversions are + * delayed and cached. Everything is recyclable. + * + * The object can represent a byte[], a char[], or a (sub) String. All + * operations can be made in case sensitive mode or not. + * + * @author d...@eng.sun.com + * @author James Todd [go...@eng.sun.com] + * @author Costin Manolache + */ +public final class MessageBytes implements Cloneable, Serializable { +private static final long serialVersionUID = 1L; + +// primary type ( whatever is set as original value ) +private int type = T_NULL; + +public static final int T_NULL = 0; +/** getType() is T_STR if the the object used to create the MessageBytes +was a String */ +public static final int T_STR = 1; +/** getType() is T_STR if the the object used to create the MessageBytes +was a byte[] */ +public static final int T_BYTES = 2; +/** getType() is T_STR if the the object used to create the MessageBytes +was a char[] */ +public static final int T_CHARS = 3; + +private int hashCode=0; +// did we compute the hashcode ? +private boolean hasHashCode=false; + +// Internal objects to represent array + offset, and specific methods +private final ByteChunk byteC=new ByteChunk(); +private final CharChunk charC=new CharChunk(); + +// String +private String strValue; +// true if a String value was computed. Probably not needed, +// strValue!=null is the same +private boolean hasStrValue=false; + +/** + * Creates a new, uninitialized MessageBytes object. + * Use static newInstance() in order to allow + * future hooks. + */ +private MessageBytes() { +} + +/** Construct a new MessageBytes instance + */ +public static MessageBytes newInstance() { +return factory.newInstance(); +} + +public boolean isNull() { +// should we check also hasStrValue ??? +return byteC.isNull() && charC.isNull() && ! hasStrValue; +// bytes==null && strValue==null; +} + +/** + * Resets the message bytes to an uninitialized (NULL) state. + */ +public void recycle() { +type=T_NULL; +byteC.recycle(); +charC.recycle(); + +strValue=null; + +hasStrValue=false; +hasHashCode=false; +hasLongValue=false; +} + + +/** + * Sets the content to the specified subarray of bytes. + * + * @param b the bytes + * @param off the start offset of the bytes + * @param len the length of the bytes + */ +public void setBytes(byte[] b, int off, int len) { +byteC.setBytes( b, off, len ); +type=T_BYTES; +hasStrValue=false; +hasHashCode=false; +hasLongValue=false; +} + +/** + * Sets the content to be a char[] + * + * @param c the bytes + * @param off the start offset of the bytes + * @param len the length of the bytes + */ +public void setChars( char[] c, int off, int len ) { +charC.setChars( c, off, len ); +type=T_CHARS; +hasStrValue=false; +hasHashCode=false; +hasLongValue=false; +} + +/** + * Set the content to be a string + */ +public voi
struts git commit: WW-4507 - adjust Tomcat url decoding code to Log4j 2 logging used in Struts
Repository: struts Updated Branches: refs/heads/master 72471d707 -> a89bbe22c WW-4507 - adjust Tomcat url decoding code to Log4j 2 logging used in Struts Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/a89bbe22 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/a89bbe22 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/a89bbe22 Branch: refs/heads/master Commit: a89bbe22cd2461748d595a89a254de888a415e6c Parents: 72471d7 Author: Rene Gielen Authored: Thu Jan 14 15:24:34 2016 +0100 Committer: Rene Gielen Committed: Thu Jan 14 15:24:34 2016 +0100 -- .../java/org/apache/struts2/util/tomcat/buf/StringCache.java | 6 +++--- .../main/java/org/apache/struts2/util/tomcat/buf/UDecoder.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/struts/blob/a89bbe22/core/src/main/java/org/apache/struts2/util/tomcat/buf/StringCache.java -- diff --git a/core/src/main/java/org/apache/struts2/util/tomcat/buf/StringCache.java b/core/src/main/java/org/apache/struts2/util/tomcat/buf/StringCache.java index 3a72d49..f982b7d 100644 --- a/core/src/main/java/org/apache/struts2/util/tomcat/buf/StringCache.java +++ b/core/src/main/java/org/apache/struts2/util/tomcat/buf/StringCache.java @@ -16,8 +16,8 @@ */ package org.apache.struts2.util.tomcat.buf; -import com.opensymphony.xwork2.util.logging.Logger; -import com.opensymphony.xwork2.util.logging.LoggerFactory; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import java.nio.charset.Charset; import java.util.ArrayList; @@ -33,7 +33,7 @@ import java.util.TreeMap; public class StringCache { -private static final Logger log = LoggerFactory.getLogger(StringCache.class); +private static final Logger log = LogManager.getLogger(StringCache.class); // --- Static Variables http://git-wip-us.apache.org/repos/asf/struts/blob/a89bbe22/core/src/main/java/org/apache/struts2/util/tomcat/buf/UDecoder.java -- diff --git a/core/src/main/java/org/apache/struts2/util/tomcat/buf/UDecoder.java b/core/src/main/java/org/apache/struts2/util/tomcat/buf/UDecoder.java index b52cda7..7f9beec 100644 --- a/core/src/main/java/org/apache/struts2/util/tomcat/buf/UDecoder.java +++ b/core/src/main/java/org/apache/struts2/util/tomcat/buf/UDecoder.java @@ -16,9 +16,9 @@ */ package org.apache.struts2.util.tomcat.buf; -import com.opensymphony.xwork2.util.logging.LoggerFactory; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; -import com.opensymphony.xwork2.util.logging.Logger; import java.io.CharConversionException; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -33,7 +33,7 @@ import java.io.UnsupportedEncodingException; */ public final class UDecoder { -private static final Logger log = LoggerFactory.getLogger(UDecoder.class); +private static final Logger log = LogManager.getLogger(UDecoder.class); public static final boolean ALLOW_ENCODED_SLASH = Boolean.parseBoolean(System.getProperty("org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH", "false"));
[1/2] struts git commit: WW-4403 - add JDK 8 profile, disabling JavaDoc lint checker when building with JDK8
Repository: struts Updated Branches: refs/heads/master a89bbe22c -> 9f6a0c9c9 refs/heads/support-2-3 5421930b4 -> 7c4bb7e7b WW-4403 - add JDK 8 profile, disabling JavaDoc lint checker when building with JDK8 Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/7c4bb7e7 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/7c4bb7e7 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/7c4bb7e7 Branch: refs/heads/support-2-3 Commit: 7c4bb7e7bd9da86eee09018c007556c12f2520e1 Parents: 5421930 Author: Rene Gielen Authored: Thu Jan 14 17:43:20 2016 +0100 Committer: Rene Gielen Committed: Thu Jan 14 17:43:20 2016 +0100 -- pom.xml | 19 +++ 1 file changed, 19 insertions(+) -- http://git-wip-us.apache.org/repos/asf/struts/blob/7c4bb7e7/pom.xml -- diff --git a/pom.xml b/pom.xml index afa95f2..e406819 100644 --- a/pom.xml +++ b/pom.xml @@ -118,6 +118,25 @@ ../maven/struts-annotations + +jdk8 + +1.8 + + + + + +org.apache.maven.plugins +maven-javadoc-plugin + + -Xdoclint:none + + + + + +
[2/2] struts git commit: WW-4403 - add JDK 8 profile, disabling JavaDoc lint checker when building with JDK8 (cherry picked from commit 7c4bb7e)
WW-4403 - add JDK 8 profile, disabling JavaDoc lint checker when building with JDK8 (cherry picked from commit 7c4bb7e) Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/9f6a0c9c Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/9f6a0c9c Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/9f6a0c9c Branch: refs/heads/master Commit: 9f6a0c9c9473a3bbe4e78d85b4b00523ac55ce64 Parents: a89bbe2 Author: Rene Gielen Authored: Thu Jan 14 17:43:20 2016 +0100 Committer: Rene Gielen Committed: Thu Jan 14 17:47:43 2016 +0100 -- pom.xml | 19 +++ 1 file changed, 19 insertions(+) -- http://git-wip-us.apache.org/repos/asf/struts/blob/9f6a0c9c/pom.xml -- diff --git a/pom.xml b/pom.xml index 862630b..07fb3b3 100644 --- a/pom.xml +++ b/pom.xml @@ -148,6 +148,25 @@ --> + +jdk8 + +1.8 + + + + + +org.apache.maven.plugins +maven-javadoc-plugin + + -Xdoclint:none + + + + + +
struts git commit: WW-4381 - exclude org.olap4j:olap4j for compile, to fix broken builds behind Maven mirror
Repository: struts Updated Branches: refs/heads/master 9f6a0c9c9 -> ee83d4a6d WW-4381 - exclude org.olap4j:olap4j for compile, to fix broken builds behind Maven mirror Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/ee83d4a6 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/ee83d4a6 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/ee83d4a6 Branch: refs/heads/master Commit: ee83d4a6dbd558ac4022194ffb419c8f46516f79 Parents: 9f6a0c9 Author: Rene Gielen Authored: Thu Jan 14 18:04:29 2016 +0100 Committer: Rene Gielen Committed: Thu Jan 14 18:04:29 2016 +0100 -- plugins/jasperreports/pom.xml | 7 +++ 1 file changed, 7 insertions(+) -- http://git-wip-us.apache.org/repos/asf/struts/blob/ee83d4a6/plugins/jasperreports/pom.xml -- diff --git a/plugins/jasperreports/pom.xml b/plugins/jasperreports/pom.xml index 612f0bb..f6a8cd6 100644 --- a/plugins/jasperreports/pom.xml +++ b/plugins/jasperreports/pom.xml @@ -43,6 +43,13 @@ jasperreports 6.0.3 provided + + + +org.olap4j +olap4j + +
[1/2] struts git commit: WW-4585 Struts2 Rest plugin doesn't handle JSESSIONID with DMI
Repository: struts Updated Branches: refs/heads/master ee83d4a6d -> e0003f047 refs/heads/support-2-3 7c4bb7e7b -> ff4cdd967 WW-4585 Struts2 Rest plugin doesn't handle JSESSIONID with DMI Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/e0003f04 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/e0003f04 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/e0003f04 Branch: refs/heads/master Commit: e0003f0471f98d5986844cd799555618aae88fce Parents: ee83d4a Author: Aleksandr Mashchenko Authored: Thu Jan 14 20:01:57 2016 +0200 Committer: Aleksandr Mashchenko Committed: Thu Jan 14 20:01:57 2016 +0200 -- .../apache/struts2/rest/RestActionMapper.java | 15 -- .../struts2/rest/RestActionMapperTest.java | 29 2 files changed, 42 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/struts/blob/e0003f04/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java -- diff --git a/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java b/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java index 816843a..d25b725 100644 --- a/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java +++ b/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java @@ -308,9 +308,20 @@ public class RestActionMapper extends DefaultActionMapper { private void handleDynamicMethodInvocation(ActionMapping mapping, String name) { int exclamation = name.lastIndexOf("!"); if (exclamation != -1) { -mapping.setName(name.substring(0, exclamation)); +String actionName = name.substring(0, exclamation); +String actionMethod = name.substring(exclamation + 1); + +// WW-4585 +// add any ; appendix to name, it will be handled later in getMapping method +int scPos = actionMethod.indexOf(';'); +if (scPos != -1) { +actionName = actionName + actionMethod.substring(scPos); +actionMethod = actionMethod.substring(0, scPos); +} + +mapping.setName(actionName); if (allowDynamicMethodCalls) { -mapping.setMethod(name.substring(exclamation + 1)); +mapping.setMethod(actionMethod); } else { mapping.setMethod(null); } http://git-wip-us.apache.org/repos/asf/struts/blob/e0003f04/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java -- diff --git a/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java b/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java index 8d39cc1..9903265 100644 --- a/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java +++ b/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java @@ -179,6 +179,35 @@ public class RestActionMapperTest extends TestCase { assertEquals("show", mapping.getMethod()); } +public void testGetJsessionIdSemicolonMappingWithMethod() throws Exception { + req.setRequestURI("/myapp/animals/dog/fido!update;jsessionid=29fefpv23do1g"); +req.setServletPath("/animals/dog/fido"); +req.setMethod("GET"); + +ActionMapping mapping = mapper.getMapping(req, configManager); + +assertEquals("/animals", mapping.getNamespace()); +assertEquals("dog", mapping.getName()); +assertEquals("fido", ((String[]) mapping.getParams().get("id"))[0]); +assertEquals("show", mapping.getMethod()); +} + +public void testGetJsessionIdSemicolonMappingWithMethodAllowDMI() throws Exception { + req.setRequestURI("/myapp/animals/dog/fido!update;jsessionid=29fefpv23do1g"); +req.setServletPath("/animals/dog/fido"); +req.setMethod("GET"); + +// allow DMI +mapper.setAllowDynamicMethodCalls("true"); + +ActionMapping mapping = mapper.getMapping(req, configManager); + +assertEquals("/animals", mapping.getNamespace()); +assertEquals("dog", mapping.getName()); +assertEquals("fido", ((String[]) mapping.getParams().get("id"))[0]); +assertEquals("update", mapping.getMethod()); +} + public void testParseNameAndNamespace() { tryUri("/foo/23", "", "foo/23"); tryUri("/foo/", "", "foo/");
[2/2] struts git commit: WW-4585 Struts2 Rest plugin doesn't handle JSESSIONID with DMI
WW-4585 Struts2 Rest plugin doesn't handle JSESSIONID with DMI Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/ff4cdd96 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/ff4cdd96 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/ff4cdd96 Branch: refs/heads/support-2-3 Commit: ff4cdd967031ed21740ee555d9e0c58b2033aa0c Parents: 7c4bb7e Author: Aleksandr Mashchenko Authored: Thu Jan 14 20:08:21 2016 +0200 Committer: Aleksandr Mashchenko Committed: Thu Jan 14 20:08:21 2016 +0200 -- .../apache/struts2/rest/RestActionMapper.java | 15 -- .../struts2/rest/RestActionMapperTest.java | 29 2 files changed, 42 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/struts/blob/ff4cdd96/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java -- diff --git a/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java b/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java index c4fd827..840ddfe 100644 --- a/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java +++ b/plugins/rest/src/main/java/org/apache/struts2/rest/RestActionMapper.java @@ -299,9 +299,20 @@ public class RestActionMapper extends DefaultActionMapper { private void handleDynamicMethodInvocation(ActionMapping mapping, String name) { int exclamation = name.lastIndexOf("!"); if (exclamation != -1) { -mapping.setName(name.substring(0, exclamation)); +String actionName = name.substring(0, exclamation); +String actionMethod = name.substring(exclamation + 1); + +// WW-4585 +// add any ; appendix to name, it will be handled later in getMapping method +int scPos = actionMethod.indexOf(';'); +if (scPos != -1) { +actionName = actionName + actionMethod.substring(scPos); +actionMethod = actionMethod.substring(0, scPos); +} + +mapping.setName(actionName); if (allowDynamicMethodCalls) { -mapping.setMethod(name.substring(exclamation + 1)); +mapping.setMethod(actionMethod); } else { mapping.setMethod(null); } http://git-wip-us.apache.org/repos/asf/struts/blob/ff4cdd96/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java -- diff --git a/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java b/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java index 8d39cc1..9903265 100644 --- a/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java +++ b/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java @@ -179,6 +179,35 @@ public class RestActionMapperTest extends TestCase { assertEquals("show", mapping.getMethod()); } +public void testGetJsessionIdSemicolonMappingWithMethod() throws Exception { + req.setRequestURI("/myapp/animals/dog/fido!update;jsessionid=29fefpv23do1g"); +req.setServletPath("/animals/dog/fido"); +req.setMethod("GET"); + +ActionMapping mapping = mapper.getMapping(req, configManager); + +assertEquals("/animals", mapping.getNamespace()); +assertEquals("dog", mapping.getName()); +assertEquals("fido", ((String[]) mapping.getParams().get("id"))[0]); +assertEquals("show", mapping.getMethod()); +} + +public void testGetJsessionIdSemicolonMappingWithMethodAllowDMI() throws Exception { + req.setRequestURI("/myapp/animals/dog/fido!update;jsessionid=29fefpv23do1g"); +req.setServletPath("/animals/dog/fido"); +req.setMethod("GET"); + +// allow DMI +mapper.setAllowDynamicMethodCalls("true"); + +ActionMapping mapping = mapper.getMapping(req, configManager); + +assertEquals("/animals", mapping.getNamespace()); +assertEquals("dog", mapping.getName()); +assertEquals("fido", ((String[]) mapping.getParams().get("id"))[0]); +assertEquals("update", mapping.getMethod()); +} + public void testParseNameAndNamespace() { tryUri("/foo/23", "", "foo/23"); tryUri("/foo/", "", "foo/");
struts git commit: make test passed for people not using GMT.
Repository: struts Updated Branches: refs/heads/support-2-3 ff4cdd967 -> a39879317 make test passed for people not using GMT. (cherry picked from commit 32ec7a669c4c1103f7778f379d5626b52954d427) Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/a3987931 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/a3987931 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/a3987931 Branch: refs/heads/support-2-3 Commit: a398793177829705345e4841974b909b3ce9e728 Parents: ff4cdd9 Author: donghui Authored: Mon Jan 4 11:23:51 2016 +0800 Committer: Aleksandr Mashchenko Committed: Thu Jan 14 20:11:54 2016 +0200 -- .../apache/struts2/rest/DefaultHttpHeadersTest.java | 16 1 file changed, 12 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/struts/blob/a3987931/plugins/rest/src/test/java/org/apache/struts2/rest/DefaultHttpHeadersTest.java -- diff --git a/plugins/rest/src/test/java/org/apache/struts2/rest/DefaultHttpHeadersTest.java b/plugins/rest/src/test/java/org/apache/struts2/rest/DefaultHttpHeadersTest.java index f46a203..d80c33b 100644 --- a/plugins/rest/src/test/java/org/apache/struts2/rest/DefaultHttpHeadersTest.java +++ b/plugins/rest/src/test/java/org/apache/struts2/rest/DefaultHttpHeadersTest.java @@ -27,6 +27,8 @@ import org.springframework.mock.web.MockHttpServletResponse; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.Locale; +import java.util.TimeZone; import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST; import static javax.servlet.http.HttpServletResponse.SC_CREATED; @@ -133,7 +135,7 @@ public class DefaultHttpHeadersTest extends TestCase { Date now = new Date(); DefaultHttpHeaders headers = new DefaultHttpHeaders() .lastModified(now); -mockRequest.addHeader("If-Modified-Since", new SimpleDateFormat("EEE, dd MMM HH:mm:ss zzz").format(now)); +mockRequest.addHeader("If-Modified-Since", getGMTDateFormat().format(now)); headers.apply(mockRequest, mockResponse, new Object()); assertEquals(SC_NOT_MODIFIED, mockResponse.getStatus()); @@ -152,7 +154,7 @@ public class DefaultHttpHeadersTest extends TestCase { public void testLastModifiedSince() { Date now = new Date(); DefaultHttpHeaders headers = new DefaultHttpHeaders().lastModified(now); -mockRequest.addHeader("If-Modified-Since", new SimpleDateFormat("EEE, dd MMM HH:mm:ss zzz").format(now)); +mockRequest.addHeader("If-Modified-Since", getGMTDateFormat().format(now)); headers.apply(mockRequest, mockResponse, new Object()); assertEquals(SC_NOT_MODIFIED, mockResponse.getStatus()); @@ -161,7 +163,7 @@ public class DefaultHttpHeadersTest extends TestCase { public void testLastModifiedSinceIsOlder() { Date now = new Date(); DefaultHttpHeaders headers = new DefaultHttpHeaders().lastModified(now); -mockRequest.addHeader("If-Modified-Since", new SimpleDateFormat("EEE, dd MMM HH:mm:ss zzz").format(new Date(now.getTime() - 1000 * 60 * 60))); +mockRequest.addHeader("If-Modified-Since", getGMTDateFormat().format(new Date(now.getTime() - 1000 * 60 * 60))); headers.apply(mockRequest, mockResponse, new Object()); assertEquals(SC_NOT_MODIFIED, mockResponse.getStatus()); @@ -173,7 +175,7 @@ public class DefaultHttpHeadersTest extends TestCase { .lastModified(now) .withETag("asdf"); mockRequest.addHeader("If-None-Match", "asdf"); -mockRequest.addHeader("If-Modified-Since", new SimpleDateFormat("EEE, dd MMM HH:mm:ss zzz").format(now)); +mockRequest.addHeader("If-Modified-Since", getGMTDateFormat().format(now)); headers.apply(mockRequest, mockResponse, new Object()); assertEquals(SC_NOT_MODIFIED, mockResponse.getStatus()); @@ -219,4 +221,10 @@ public class DefaultHttpHeadersTest extends TestCase { assertEquals(SC_OK, mockResponse.getStatus()); } + +private SimpleDateFormat getGMTDateFormat() { +SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM HH:mm:ss zzz", Locale.US); +format.setTimeZone(TimeZone.getTimeZone("GMT")); +return format; +} }