You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2014/03/19 20:49:55 UTC
[01/16] git commit: Uses URL class to check if location is path or
full url
Repository: struts
Updated Branches:
refs/heads/develop ae12bd765 -> 4fbfa3b8b
refs/heads/feature/WW-4267-removes-defaults f2b52612b -> bd2a5ea8d
Uses URL class to check if location is path or full url
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/4b7d2e35
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/4b7d2e35
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/4b7d2e35
Branch: refs/heads/feature/WW-4267-removes-defaults
Commit: 4b7d2e35d09225a7c8b3b410588131b692b2730f
Parents: bcd61a0
Author: Lukasz Lenart <lu...@apache.org>
Authored: Sun Mar 9 21:46:33 2014 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Sun Mar 9 21:46:33 2014 +0100
----------------------------------------------------------------------
.../dispatcher/ServletRedirectResult.java | 23 ++++++++++++++------
1 file changed, 16 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/4b7d2e35/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java b/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java
index abc69eb..038d8c3 100644
--- a/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java
+++ b/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java
@@ -37,6 +37,9 @@ import org.apache.struts2.views.util.UrlHelper;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URI;
+import java.net.URLConnection;
import java.util.*;
import static javax.servlet.http.HttpServletResponse.SC_FOUND;
@@ -262,13 +265,19 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
}
- private boolean isPathUrl(String url) {
- // filter out "http:", "https:", "mailto:", "file:", "ftp:"
- return !url.startsWith("http:")
- && !url.startsWith("https:")
- && !url.startsWith("mailto:")
- && !url.startsWith("file:")
- && !url.startsWith("ftp:");
+ /**
+ * Checks if url is simple path or either full url
+ *
+ * @param url string
+ * @return true if it's just a path not a full url
+ */
+ protected boolean isPathUrl(String url) {
+ try {
+ return URI.create(url).getScheme() == null;
+ } catch (IllegalArgumentException e) {
+ LOG.debug("[#0] isn't a valid URL", e, url);
+ return false;
+ }
}
/**
[03/16] git commit: Comments out defaults which are already defined
in Java classes
Posted by lu...@apache.org.
Comments out defaults which are already defined in Java classes
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/f2b52612
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/f2b52612
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/f2b52612
Branch: refs/heads/develop
Commit: f2b52612b8d3cf3cd6a01cc8246769c5ec4fc789
Parents: aa744b8
Author: Lukasz Lenart <lu...@apache.org>
Authored: Thu Mar 13 19:16:13 2014 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Thu Mar 13 19:16:13 2014 +0100
----------------------------------------------------------------------
core/src/main/resources/org/apache/struts2/default.properties | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/f2b52612/core/src/main/resources/org/apache/struts2/default.properties
----------------------------------------------------------------------
diff --git a/core/src/main/resources/org/apache/struts2/default.properties b/core/src/main/resources/org/apache/struts2/default.properties
index ea3bc0c..5d49802 100644
--- a/core/src/main/resources/org/apache/struts2/default.properties
+++ b/core/src/main/resources/org/apache/struts2/default.properties
@@ -135,7 +135,7 @@ struts.devMode = false
### when set to true, resource bundles will be reloaded on _every_ request.
### this is good during development, but should never be used in production
-struts.i18n.reload=false
+### struts.i18n.reload=false
### Standard UI theme
### Change this to reflect which path should be used for JSP control tag templates by default
@@ -148,7 +148,7 @@ struts.ui.templateSuffix=ftl
### Configuration reloading
### This will cause the configuration to reload struts.xml when it is changed
-struts.configuration.xml.reload=false
+### struts.configuration.xml.reload=false
### Location of velocity.properties file. defaults to velocity.properties
struts.velocity.configfile = velocity.properties
@@ -179,7 +179,7 @@ struts.dispatcher.parametersWorkaround = false
### Enables caching of FreeMarker templates
### Has the same effect as copying the templates under WEB_APP/templates
-struts.freemarker.templatesCache=false
+### struts.freemarker.templatesCache=false
### Enables caching of models on the BeanWrapper
struts.freemarker.beanwrapperCache=false
[10/16] git commit: No JIRA - edit JavaDoc for class to make it
clearer how to assign a value to a parameter when that value is a literal
string
Posted by lu...@apache.org.
No JIRA - edit JavaDoc for class to make it clearer how to assign a value to a parameter when that value is a literal string
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/561063a4
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/561063a4
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/561063a4
Branch: refs/heads/feature/WW-4267-removes-defaults
Commit: 561063a4227dd609ccba83880b2d0c6ec2d1e4aa
Parents: cb9f0f5
Author: phillips1021 <ph...@hotmail.com>
Authored: Tue Mar 18 09:48:18 2014 -0500
Committer: phillips1021 <ph...@hotmail.com>
Committed: Tue Mar 18 09:48:18 2014 -0500
----------------------------------------------------------------------
.../main/java/org/apache/struts2/components/GenericUIBean.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/561063a4/core/src/main/java/org/apache/struts2/components/GenericUIBean.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/components/GenericUIBean.java b/core/src/main/java/org/apache/struts2/components/GenericUIBean.java
index 64dfabe..9521e1f 100644
--- a/core/src/main/java/org/apache/struts2/components/GenericUIBean.java
+++ b/core/src/main/java/org/apache/struts2/components/GenericUIBean.java
@@ -56,9 +56,8 @@ import com.opensymphony.xwork2.util.ValueStack;
* engine will be found based on file extension.<p/>
*
* <b>Remember:</b> the value params will always be resolved against the ValueStack so if you mean to pass a
- * string literal to your component, make sure to wrap it in quotes i.e. value="'value1'" otherwise, the the value
- * stack will search for an Object on the stack with a method of getValue1(). (now that i've written this, i'm not
- * entirely sure this is the case. i should verify this manana)<p/>
+ * string literal to your component, make sure to wrap it in single quotes i.e. value="'value1'" (note the opening "' and closing '" otherwise, the the value
+ * stack will search for an Object on the stack with a method of getValue1().<p/>
*
* <!-- END SNIPPET: javadoc -->
*
[15/16] git commit: Merge branch 'develop' into
feature/WW-4267-removes-defaults
Posted by lu...@apache.org.
Merge branch 'develop' into feature/WW-4267-removes-defaults
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/bd2a5ea8
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/bd2a5ea8
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/bd2a5ea8
Branch: refs/heads/feature/WW-4267-removes-defaults
Commit: bd2a5ea8d5f5dc6468f4883c0768066f4e721fe1
Parents: f2b5261 ae12bd7
Author: Lukasz Lenart <lu...@apache.org>
Authored: Wed Mar 19 20:41:16 2014 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Wed Mar 19 20:41:16 2014 +0100
----------------------------------------------------------------------
.../struts2/components/GenericUIBean.java | 5 +--
.../org/apache/struts2/components/Hidden.java | 7 ++++
.../org/apache/struts2/components/UIBean.java | 9 ++++-
.../dispatcher/ServletRedirectResult.java | 42 ++++++++++++++++----
.../main/resources/template/xhtml/hidden.ftl | 27 +++++++++++++
.../apache/struts2/StrutsInternalTestCase.java | 9 ++---
.../struts2/views/jsp/AbstractTagTest.java | 4 +-
.../apache/struts2/views/jsp/ui/Hidden-1.txt | 6 ++-
.../apache/struts2/views/jsp/ui/Hidden-2.txt | 6 ++-
9 files changed, 93 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
[05/16] git commit: Extends Hidden tests results to match new xhtml
theme
Posted by lu...@apache.org.
Extends Hidden tests results to match new xhtml theme
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/43e86d76
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/43e86d76
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/43e86d76
Branch: refs/heads/feature/WW-4267-removes-defaults
Commit: 43e86d76d5dc6bc7b6261e91eaddcee2cc009a6b
Parents: cdf3c5c
Author: Lukasz Lenart <lu...@apache.org>
Authored: Thu Mar 13 20:19:59 2014 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Thu Mar 13 20:19:59 2014 +0100
----------------------------------------------------------------------
.../resources/org/apache/struts2/views/jsp/ui/Hidden-1.txt | 8 +++++++-
.../resources/org/apache/struts2/views/jsp/ui/Hidden-2.txt | 8 +++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/43e86d76/core/src/test/resources/org/apache/struts2/views/jsp/ui/Hidden-1.txt
----------------------------------------------------------------------
diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/Hidden-1.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/Hidden-1.txt
index 4d6c927..fafc7ba 100644
--- a/core/src/test/resources/org/apache/struts2/views/jsp/ui/Hidden-1.txt
+++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/Hidden-1.txt
@@ -1 +1,7 @@
-<input type="hidden" name="myname" value="bar" id="myname"/>
+<tr>
+ <td class="tdLabel">
+ </td>
+ <td>
+ <input type="hidden" name="myname" value="bar" id="myname"/>
+ </td>
+</tr>
http://git-wip-us.apache.org/repos/asf/struts/blob/43e86d76/core/src/test/resources/org/apache/struts2/views/jsp/ui/Hidden-2.txt
----------------------------------------------------------------------
diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/Hidden-2.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/Hidden-2.txt
index 2cc5ab6..df7e11b 100644
--- a/core/src/test/resources/org/apache/struts2/views/jsp/ui/Hidden-2.txt
+++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/Hidden-2.txt
@@ -1 +1,7 @@
-<input type="hidden" name="myname" value="bar" id="myname" disabled="disabled"/>
+<tr>
+ <td class="tdLabel">
+ </td>
+ <td>
+ <input type="hidden" name="myname" value="bar" id="myname" disabled="disabled"/>
+ </td>
+</tr>
[13/16] git commit: WW-4187 finshes work: protocols are identified
based on URL class
Posted by lu...@apache.org.
WW-4187 finshes work: protocols are identified based on URL class
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/ae12bd76
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/ae12bd76
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/ae12bd76
Branch: refs/heads/feature/WW-4267-removes-defaults
Commit: ae12bd76551baab3ab9e3df7655fe579e526c5d7
Parents: 561063a 3c1d25c
Author: Lukasz Lenart <lu...@apache.org>
Authored: Wed Mar 19 09:38:10 2014 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Wed Mar 19 09:38:10 2014 +0100
----------------------------------------------------------------------
.../dispatcher/ServletRedirectResult.java | 42 ++++++++++++++++----
1 file changed, 35 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
[16/16] git commit: WW-4267 finishes merging changes to develop
Posted by lu...@apache.org.
WW-4267 finishes merging changes to develop
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/4fbfa3b8
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/4fbfa3b8
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/4fbfa3b8
Branch: refs/heads/develop
Commit: 4fbfa3b8b2a71a36a55fec0a25dbc00939e3fdf9
Parents: ae12bd7 bd2a5ea
Author: Lukasz Lenart <lu...@apache.org>
Authored: Wed Mar 19 20:46:12 2014 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Wed Mar 19 20:46:12 2014 +0100
----------------------------------------------------------------------
core/src/main/resources/org/apache/struts2/default.properties | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
[11/16] git commit: Reverts returned values to match logic and checks
if protocol is not null
Posted by lu...@apache.org.
Reverts returned values to match logic and checks if protocol is not null
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/d59fb2b9
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/d59fb2b9
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/d59fb2b9
Branch: refs/heads/feature/WW-4267-removes-defaults
Commit: d59fb2b9ecd6e43a9029583f720002a072d965fb
Parents: 1ca55b8
Author: Lukasz Lenart <lu...@apache.org>
Authored: Wed Mar 19 08:50:56 2014 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Wed Mar 19 08:50:56 2014 +0100
----------------------------------------------------------------------
.../apache/struts2/dispatcher/ServletRedirectResult.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/d59fb2b9/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java b/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java
index 9820295..e4347b0 100644
--- a/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java
+++ b/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java
@@ -39,6 +39,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;
+import java.net.URL;
import java.util.*;
import static javax.servlet.http.HttpServletResponse.SC_FOUND;
@@ -274,27 +275,27 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
try {
URI uri = URI.create(url);
if (uri.isAbsolute()) {
- uri.toURL();
+ URL validUrl = uri.toURL();
if (LOG.isDebugEnabled()) {
LOG.debug("[#0] is full url, not a path", url);
}
- return true;
+ return validUrl.getProtocol() == null;
} else {
if (LOG.isDebugEnabled()) {
LOG.debug("[#0] isn't absolute URI, assuming it's a path", url);
}
- return false;
+ return true;
}
} catch (IllegalArgumentException e) {
if (LOG.isDebugEnabled()) {
LOG.debug("[#0] isn't a valid URL, assuming it's a path", e, url);
}
- return false;
+ return true;
} catch (MalformedURLException e) {
if (LOG.isDebugEnabled()) {
LOG.debug("[#0] isn't a valid URL, assuming it's a path", e, url);
}
- return false;
+ return true;
}
}
[04/16] git commit: Extends Hidden to support xhtml theme properly
Posted by lu...@apache.org.
Extends Hidden to support xhtml theme properly
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/cdf3c5cb
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/cdf3c5cb
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/cdf3c5cb
Branch: refs/heads/feature/WW-4267-removes-defaults
Commit: cdf3c5cbf120d984049bb6d292193d8620d52639
Parents: aa744b8
Author: Lukasz Lenart <lu...@apache.org>
Authored: Thu Mar 13 20:17:01 2014 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Thu Mar 13 20:17:01 2014 +0100
----------------------------------------------------------------------
.../org/apache/struts2/components/Hidden.java | 7 ++++++
.../main/resources/template/xhtml/hidden.ftl | 25 ++++++++++++++++++++
2 files changed, 32 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/cdf3c5cb/core/src/main/java/org/apache/struts2/components/Hidden.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/components/Hidden.java b/core/src/main/java/org/apache/struts2/components/Hidden.java
index 62efc44..36b03d1 100644
--- a/core/src/main/java/org/apache/struts2/components/Hidden.java
+++ b/core/src/main/java/org/apache/struts2/components/Hidden.java
@@ -65,4 +65,11 @@ public class Hidden extends UIBean {
protected String getDefaultTemplate() {
return TEMPLATE;
}
+
+ @Override
+ public void evaluateParams() {
+ super.evaluateParams();
+ label = null;
+ addParameter("label", null);
+ }
}
http://git-wip-us.apache.org/repos/asf/struts/blob/cdf3c5cb/core/src/main/resources/template/xhtml/hidden.ftl
----------------------------------------------------------------------
diff --git a/core/src/main/resources/template/xhtml/hidden.ftl b/core/src/main/resources/template/xhtml/hidden.ftl
new file mode 100644
index 0000000..3ff0f05
--- /dev/null
+++ b/core/src/main/resources/template/xhtml/hidden.ftl
@@ -0,0 +1,25 @@
+<#--
+/*
+ * $Id$
+ *
+ * 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.
+ */
+-->
+<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" />
+<#include "/${parameters.templateDir}/simple/hidden.ftl" />
+<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" />
[09/16] git commit: https://issues.apache.org/jira/browse/WW-4299 -
do not assign value to id parameter if tryId value is null this prevents
overwriting a parameter with a name of id used with the component tag
Posted by lu...@apache.org.
https://issues.apache.org/jira/browse/WW-4299 - do not assign value to id parameter if tryId value is null this prevents overwriting a parameter with a name of id used with the component tag
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/cb9f0f56
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/cb9f0f56
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/cb9f0f56
Branch: refs/heads/feature/WW-4267-removes-defaults
Commit: cb9f0f5645d05b2f1c7c66640716acff61c4425f
Parents: 3ceb3b9
Author: phillips1021 <ph...@hotmail.com>
Authored: Tue Mar 18 09:46:36 2014 -0500
Committer: phillips1021 <ph...@hotmail.com>
Committed: Tue Mar 18 09:46:36 2014 -0500
----------------------------------------------------------------------
.../src/main/java/org/apache/struts2/components/UIBean.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/cb9f0f56/core/src/main/java/org/apache/struts2/components/UIBean.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/components/UIBean.java b/core/src/main/java/org/apache/struts2/components/UIBean.java
index 9418a6e..51b7e79 100644
--- a/core/src/main/java/org/apache/struts2/components/UIBean.java
+++ b/core/src/main/java/org/apache/struts2/components/UIBean.java
@@ -1024,8 +1024,13 @@ public abstract class UIBean extends Component {
} else {
tryId = generatedId;
}
- addParameter("id", tryId);
- addParameter("escapedId", escape(tryId));
+
+ //fix for https://issues.apache.org/jira/browse/WW-4299
+ //do not assign value to id if tryId is null
+ if (tryId != null) {
+ addParameter("id", tryId);
+ addParameter("escapedId", escape(tryId));
+ }
}
/**
[06/16] git commit: Improves tests to reuse the same ServletContext
Posted by lu...@apache.org.
Improves tests to reuse the same ServletContext
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/924531c5
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/924531c5
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/924531c5
Branch: refs/heads/feature/WW-4267-removes-defaults
Commit: 924531c54400882d1781ba3067d7af63825850c3
Parents: 43e86d7
Author: Lukasz Lenart <lu...@apache.org>
Authored: Thu Mar 13 20:20:25 2014 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Thu Mar 13 20:20:25 2014 +0100
----------------------------------------------------------------------
.../java/org/apache/struts2/StrutsInternalTestCase.java | 9 ++++-----
.../java/org/apache/struts2/views/jsp/AbstractTagTest.java | 4 +---
2 files changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/924531c5/core/src/test/java/org/apache/struts2/StrutsInternalTestCase.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/struts2/StrutsInternalTestCase.java b/core/src/test/java/org/apache/struts2/StrutsInternalTestCase.java
index 0b9d1c4..6816481 100644
--- a/core/src/test/java/org/apache/struts2/StrutsInternalTestCase.java
+++ b/core/src/test/java/org/apache/struts2/StrutsInternalTestCase.java
@@ -21,15 +21,12 @@
package org.apache.struts2;
-import com.opensymphony.xwork2.ActionProxyFactory;
import com.opensymphony.xwork2.XWorkTestCase;
-import com.opensymphony.xwork2.config.ConfigurationProvider;
-import com.opensymphony.xwork2.util.XWorkTestCaseHelper;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import com.opensymphony.xwork2.util.logging.jdk.JdkLoggerFactory;
import org.apache.struts2.dispatcher.Dispatcher;
import org.apache.struts2.util.StrutsTestCaseHelper;
-import org.springframework.mock.web.MockServletContext;
+import org.apache.struts2.views.jsp.StrutsMockServletContext;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -75,6 +72,7 @@ public abstract class StrutsInternalTestCase extends XWorkTestCase {
LoggerFactory.setLoggerFactory(new JdkLoggerFactory());
}
+ protected StrutsMockServletContext servletContext;
protected Dispatcher dispatcher;
/**
@@ -87,7 +85,8 @@ public abstract class StrutsInternalTestCase extends XWorkTestCase {
}
protected Dispatcher initDispatcher(Map<String,String> params) {
- dispatcher = StrutsTestCaseHelper.initDispatcher(new MockServletContext(), params);
+ servletContext = new StrutsMockServletContext();
+ dispatcher = StrutsTestCaseHelper.initDispatcher(servletContext, params);
configurationManager = dispatcher.getConfigurationManager();
configuration = configurationManager.getConfiguration();
container = configuration.getContainer();
http://git-wip-us.apache.org/repos/asf/struts/blob/924531c5/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java b/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java
index 36b04fa..60eb170 100644
--- a/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java
+++ b/core/src/test/java/org/apache/struts2/views/jsp/AbstractTagTest.java
@@ -61,7 +61,6 @@ public abstract class AbstractTagTest extends StrutsInternalTestCase {
protected StrutsMockHttpServletRequest request;
protected StrutsMockPageContext pageContext;
protected HttpServletResponse response;
- protected StrutsMockServletContext servletContext;
protected Mock mockContainer;
@@ -83,7 +82,7 @@ public abstract class AbstractTagTest extends StrutsInternalTestCase {
createMocks();
}
- protected void createMocks() {
+ protected void createMocks() throws Exception {
action = this.getAction();
stack = ActionContext.getContext().getValueStack();
context = stack.getContext();
@@ -99,7 +98,6 @@ public abstract class AbstractTagTest extends StrutsInternalTestCase {
JspWriter jspWriter = new StrutsMockJspWriter(writer);
- servletContext = new StrutsMockServletContext();
servletContext.setRealPath(new File("nosuchfile.properties").getAbsolutePath());
servletContext.setServletInfo("Resin");
[02/16] git commit: Extends logic how protocol part of url is
extracted
Posted by lu...@apache.org.
Extends logic how protocol part of url is extracted
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/1ca55b8a
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/1ca55b8a
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/1ca55b8a
Branch: refs/heads/feature/WW-4267-removes-defaults
Commit: 1ca55b8a79cc118128391bddd3b776024def79f8
Parents: 4b7d2e3
Author: Lukasz Lenart <lu...@apache.org>
Authored: Sun Mar 9 21:57:58 2014 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Sun Mar 9 21:57:58 2014 +0100
----------------------------------------------------------------------
.../dispatcher/ServletRedirectResult.java | 26 +++++++++++++++++---
1 file changed, 22 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/1ca55b8a/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java b/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java
index 038d8c3..9820295 100644
--- a/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java
+++ b/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java
@@ -37,9 +37,8 @@ import org.apache.struts2.views.util.UrlHelper;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
-import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
import java.net.URI;
-import java.net.URLConnection;
import java.util.*;
import static javax.servlet.http.HttpServletResponse.SC_FOUND;
@@ -273,9 +272,28 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
*/
protected boolean isPathUrl(String url) {
try {
- return URI.create(url).getScheme() == null;
+ URI uri = URI.create(url);
+ if (uri.isAbsolute()) {
+ uri.toURL();
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("[#0] is full url, not a path", url);
+ }
+ return true;
+ } else {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("[#0] isn't absolute URI, assuming it's a path", url);
+ }
+ return false;
+ }
} catch (IllegalArgumentException e) {
- LOG.debug("[#0] isn't a valid URL", e, url);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("[#0] isn't a valid URL, assuming it's a path", e, url);
+ }
+ return false;
+ } catch (MalformedURLException e) {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("[#0] isn't a valid URL, assuming it's a path", e, url);
+ }
return false;
}
}
[07/16] git commit: WW-4297 finishes feature: improves hidden tag to
properly support xhtml theme
Posted by lu...@apache.org.
WW-4297 finishes feature: improves hidden tag to properly support xhtml theme
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/d63deb97
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/d63deb97
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/d63deb97
Branch: refs/heads/feature/WW-4267-removes-defaults
Commit: d63deb9750a3d409be30414faaf76f5481a4417d
Parents: aa744b8 924531c
Author: Lukasz Lenart <lu...@apache.org>
Authored: Thu Mar 13 20:21:50 2014 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Thu Mar 13 20:21:50 2014 +0100
----------------------------------------------------------------------
.../org/apache/struts2/components/Hidden.java | 7 ++++++
.../main/resources/template/xhtml/hidden.ftl | 25 ++++++++++++++++++++
.../apache/struts2/StrutsInternalTestCase.java | 9 ++++---
.../struts2/views/jsp/AbstractTagTest.java | 4 +---
.../apache/struts2/views/jsp/ui/Hidden-1.txt | 8 ++++++-
.../apache/struts2/views/jsp/ui/Hidden-2.txt | 8 ++++++-
6 files changed, 51 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
[12/16] git commit: Merge branch 'develop' into
feature/WW-4187-correctly-identify-protocols
Posted by lu...@apache.org.
Merge branch 'develop' into feature/WW-4187-correctly-identify-protocols
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/3c1d25c0
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/3c1d25c0
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/3c1d25c0
Branch: refs/heads/feature/WW-4267-removes-defaults
Commit: 3c1d25c04f1d1a65fca15d1c2de062dd1ae54f34
Parents: d59fb2b 561063a
Author: Lukasz Lenart <lu...@apache.org>
Authored: Wed Mar 19 08:52:14 2014 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Wed Mar 19 08:52:14 2014 +0100
----------------------------------------------------------------------
.../struts2/components/GenericUIBean.java | 5 +-
.../org/apache/struts2/components/Hidden.java | 7 ++
.../org/apache/struts2/components/UIBean.java | 9 ++-
.../template/xhtml/form-close-validate.ftl | 2 +-
.../main/resources/template/xhtml/hidden.ftl | 27 +++++++
.../apache/struts2/StrutsInternalTestCase.java | 9 ++-
.../struts2/views/jsp/AbstractTagTest.java | 4 +-
.../apache/struts2/views/jsp/ui/Hidden-1.txt | 6 +-
.../apache/struts2/views/jsp/ui/Hidden-2.txt | 6 +-
.../com/opensymphony/xwork2/util/URLUtil.java | 1 +
...nnotationValidationConfigurationBuilder.java | 6 ++
.../validator/annotations/UrlValidator.java | 76 +++-----------------
.../validator/validators/URLValidator.java | 66 +++++++++++------
.../xwork2/validator/URLValidatorTest.java | 50 +++++++++++++
14 files changed, 170 insertions(+), 104 deletions(-)
----------------------------------------------------------------------
[14/16] git commit: Merge branch 'develop' into
feature/WW-4267-removes-defaults
Posted by lu...@apache.org.
Merge branch 'develop' into feature/WW-4267-removes-defaults
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/bd2a5ea8
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/bd2a5ea8
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/bd2a5ea8
Branch: refs/heads/develop
Commit: bd2a5ea8d5f5dc6468f4883c0768066f4e721fe1
Parents: f2b5261 ae12bd7
Author: Lukasz Lenart <lu...@apache.org>
Authored: Wed Mar 19 20:41:16 2014 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Wed Mar 19 20:41:16 2014 +0100
----------------------------------------------------------------------
.../struts2/components/GenericUIBean.java | 5 +--
.../org/apache/struts2/components/Hidden.java | 7 ++++
.../org/apache/struts2/components/UIBean.java | 9 ++++-
.../dispatcher/ServletRedirectResult.java | 42 ++++++++++++++++----
.../main/resources/template/xhtml/hidden.ftl | 27 +++++++++++++
.../apache/struts2/StrutsInternalTestCase.java | 9 ++---
.../struts2/views/jsp/AbstractTagTest.java | 4 +-
.../apache/struts2/views/jsp/ui/Hidden-1.txt | 6 ++-
.../apache/struts2/views/jsp/ui/Hidden-2.txt | 6 ++-
9 files changed, 93 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
[08/16] git commit: Uses simplest approach to inline s:hidden tag to
xhtml theme
Posted by lu...@apache.org.
Uses simplest approach to inline s:hidden tag to xhtml theme
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/3ceb3b97
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/3ceb3b97
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/3ceb3b97
Branch: refs/heads/feature/WW-4267-removes-defaults
Commit: 3ceb3b973ea53a5e0f8f2c3b772eb50daee6aec0
Parents: d63deb9
Author: Lukasz Lenart <lu...@apache.org>
Authored: Thu Mar 13 21:49:54 2014 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Thu Mar 13 21:49:54 2014 +0100
----------------------------------------------------------------------
core/src/main/resources/template/xhtml/hidden.ftl | 8 +++++---
.../resources/org/apache/struts2/views/jsp/ui/Hidden-1.txt | 6 ++----
.../resources/org/apache/struts2/views/jsp/ui/Hidden-2.txt | 6 ++----
3 files changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/3ceb3b97/core/src/main/resources/template/xhtml/hidden.ftl
----------------------------------------------------------------------
diff --git a/core/src/main/resources/template/xhtml/hidden.ftl b/core/src/main/resources/template/xhtml/hidden.ftl
index 3ff0f05..92881ab 100644
--- a/core/src/main/resources/template/xhtml/hidden.ftl
+++ b/core/src/main/resources/template/xhtml/hidden.ftl
@@ -20,6 +20,8 @@
* under the License.
*/
-->
-<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" />
-<#include "/${parameters.templateDir}/simple/hidden.ftl" />
-<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" />
+<tr style="display:none;">
+ <td colspan="2">
+ <#include "/${parameters.templateDir}/simple/hidden.ftl" />
+ </td>
+</tr>
http://git-wip-us.apache.org/repos/asf/struts/blob/3ceb3b97/core/src/test/resources/org/apache/struts2/views/jsp/ui/Hidden-1.txt
----------------------------------------------------------------------
diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/Hidden-1.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/Hidden-1.txt
index fafc7ba..875ee46 100644
--- a/core/src/test/resources/org/apache/struts2/views/jsp/ui/Hidden-1.txt
+++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/Hidden-1.txt
@@ -1,7 +1,5 @@
-<tr>
- <td class="tdLabel">
- </td>
- <td>
+<tr style="display:none;">
+ <td colspan="2">
<input type="hidden" name="myname" value="bar" id="myname"/>
</td>
</tr>
http://git-wip-us.apache.org/repos/asf/struts/blob/3ceb3b97/core/src/test/resources/org/apache/struts2/views/jsp/ui/Hidden-2.txt
----------------------------------------------------------------------
diff --git a/core/src/test/resources/org/apache/struts2/views/jsp/ui/Hidden-2.txt b/core/src/test/resources/org/apache/struts2/views/jsp/ui/Hidden-2.txt
index df7e11b..a5376ff 100644
--- a/core/src/test/resources/org/apache/struts2/views/jsp/ui/Hidden-2.txt
+++ b/core/src/test/resources/org/apache/struts2/views/jsp/ui/Hidden-2.txt
@@ -1,7 +1,5 @@
-<tr>
- <td class="tdLabel">
- </td>
- <td>
+<tr style="display:none;">
+ <td colspan="2">
<input type="hidden" name="myname" value="bar" id="myname" disabled="disabled"/>
</td>
</tr>