svn commit: r1519588 - in /struts/struts2/trunk/xwork-core/src: main/java/com/opensymphony/xwork2/config/impl/ main/java/com/opensymphony/xwork2/ognl/ test/java/com/opensymphony/xwork2/ognl/

2013-09-03 Thread lukaszlenart
Author: lukaszlenart
Date: Tue Sep  3 07:37:04 2013
New Revision: 1519588

URL: http://svn.apache.org/r1519588
Log:
WW-4186 Removes static and uses instance value to set enableExpressionCache 
constant

Modified:

struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java

struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/MockConfiguration.java

struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java

struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java

Modified: 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java?rev=1519588&r1=1519587&r2=1519588&view=diff
==
--- 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java
 (original)
+++ 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java
 Tue Sep  3 07:37:04 2013
@@ -335,6 +335,7 @@ public class DefaultConfiguration implem
 builder.constant(XWorkConstants.DEV_MODE, "false");
 builder.constant(XWorkConstants.LOG_MISSING_PROPERTIES, "false");
 builder.constant(XWorkConstants.ENABLE_OGNL_EVAL_EXPRESSION, "false");
+builder.constant(XWorkConstants.ENABLE_OGNL_EXPRESSION_CACHE, "true");
 builder.constant(XWorkConstants.RELOAD_XML_CONFIGURATION, "false");
 return builder.create(true);
 }

Modified: 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/MockConfiguration.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/MockConfiguration.java?rev=1519588&r1=1519587&r2=1519588&view=diff
==
--- 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/MockConfiguration.java
 (original)
+++ 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/MockConfiguration.java
 Tue Sep  3 07:37:04 2013
@@ -59,6 +59,7 @@ public class MockConfiguration implement
 new XWorkConfigurationProvider().register(builder, props);
 builder.constant(XWorkConstants.DEV_MODE, "false");
 builder.constant(XWorkConstants.RELOAD_XML_CONFIGURATION, "true");
+builder.constant(XWorkConstants.ENABLE_OGNL_EXPRESSION_CACHE, "true");
 container = builder.create(true);
 }
 

Modified: 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java?rev=1519588&r1=1519587&r2=1519588&view=diff
==
--- 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
 (original)
+++ 
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlUtil.java
 Tue Sep  3 07:37:04 2013
@@ -52,10 +52,10 @@ public class OgnlUtil {
 private static final Logger LOG = LoggerFactory.getLogger(OgnlUtil.class);
 private ConcurrentMap expressions = new 
ConcurrentHashMap();
 private final ConcurrentMap beanInfoCache = new 
ConcurrentHashMap();
-
 private TypeConverter defaultConverter;
-static boolean devMode = false;
-static boolean enableExpressionCache = true;
+
+private boolean devMode = false;
+private boolean enableExpressionCache = true;
 private boolean enableEvalExpression;
 
 @Inject
@@ -64,12 +64,12 @@ public class OgnlUtil {
 }
 
 @Inject(XWorkConstants.DEV_MODE)
-public static void setDevMode(String mode) {
+public void setDevMode(String mode) {
 devMode = "true".equals(mode);
 }
 
 @Inject(XWorkConstants.ENABLE_OGNL_EXPRESSION_CACHE)
-public static void setEnableExpressionCache(String cache) {
+public void setEnableExpressionCache(String cache) {
enableExpressionCache = "true".equals(cache);
 }
 
@@ -464,10 +464,8 @@ public class OgnlUtil {
 
 if (throwPropertyExceptions) {
 throw new ReflectionException(msg, exception);
-} else {
-if (devMode) {
-LOG.warn(msg, exception);
-}
+} else if (devMode) {
+LOG.warn(msg, exception);
 }
 }
 }

Modified: 
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUtilTest.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/ognl/OgnlUti

svn commit: r1519696 - /struts/site/trunk/content/xdoc/primer.xml

2013-09-03 Thread grobmeier
Author: grobmeier
Date: Tue Sep  3 14:26:43 2013
New Revision: 1519696

URL: http://svn.apache.org/r1519696
Log:
objectstyle cayenne is now Apache Cayenne

Modified:
struts/site/trunk/content/xdoc/primer.xml

Modified: struts/site/trunk/content/xdoc/primer.xml
URL: 
http://svn.apache.org/viewvc/struts/site/trunk/content/xdoc/primer.xml?rev=1519696&r1=1519695&r2=1519696&view=diff
==
--- struts/site/trunk/content/xdoc/primer.xml (original)
+++ struts/site/trunk/content/xdoc/primer.xml Tue Sep  3 14:26:43 2013
@@ -1552,10 +1552,8 @@ limitations under the License.
 
 
 
-
 
-http://www.objectstyle.org/cayenne/";>
-Cayenne
+http://cayenne.apache.org/";>Apache Cayenne
 
 
 http://java.sun.com/products/ejb/index.html";>




svn commit: r877166 - in /websites/staging/struts/trunk/content: ./ dev/

2013-09-03 Thread buildbot
Author: buildbot
Date: Tue Sep  3 14:28:22 2013
New Revision: 877166

Log:
Staging update by buildbot for struts

Modified:
websites/staging/struts/trunk/content/   (props changed)
websites/staging/struts/trunk/content/announce-2002.html
websites/staging/struts/trunk/content/announce-2003.html
websites/staging/struts/trunk/content/announce-2004.html
websites/staging/struts/trunk/content/announce-2005.html
websites/staging/struts/trunk/content/announce-2006.html
websites/staging/struts/trunk/content/announce-2007.html
websites/staging/struts/trunk/content/announce-2008.html
websites/staging/struts/trunk/content/announce-2009.html
websites/staging/struts/trunk/content/announce-2010.html
websites/staging/struts/trunk/content/announce-2011.html
websites/staging/struts/trunk/content/announce-2012.html
websites/staging/struts/trunk/content/announce.html
websites/staging/struts/trunk/content/dev/builds.html
websites/staging/struts/trunk/content/dev/bylaws.html
websites/staging/struts/trunk/content/dev/dev-mail.html
websites/staging/struts/trunk/content/dev/minutes.html
websites/staging/struts/trunk/content/dev/releases.html
websites/staging/struts/trunk/content/dev/site.html
websites/staging/struts/trunk/content/dev/volunteers.html
websites/staging/struts/trunk/content/download.html
websites/staging/struts/trunk/content/downloads.html
websites/staging/struts/trunk/content/faqs.html
websites/staging/struts/trunk/content/helping.html
websites/staging/struts/trunk/content/index.html
websites/staging/struts/trunk/content/javadoc.html
websites/staging/struts/trunk/content/kickstart.html
websites/staging/struts/trunk/content/mail.html
websites/staging/struts/trunk/content/primer.html
websites/staging/struts/trunk/content/release-checklist.html
websites/staging/struts/trunk/content/roadmap.html
websites/staging/struts/trunk/content/security.html
websites/staging/struts/trunk/content/struts1eol-announcement.html
websites/staging/struts/trunk/content/struts1eol-press.html

Propchange: websites/staging/struts/trunk/content/
--
--- cms:source-revision (original)
+++ cms:source-revision Tue Sep  3 14:28:22 2013
@@ -1 +1 @@
-1519437
+1519696

Modified: websites/staging/struts/trunk/content/announce-2002.html
==
--- websites/staging/struts/trunk/content/announce-2002.html (original)
+++ websites/staging/struts/trunk/content/announce-2002.html Tue Sep  3 
14:28:22 2013
@@ -1,13 +1,13 @@
 
 
 http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
   
 
 
-
+
 
 
 Announcements - 2002 and prior
@@ -54,7 +54,7 @@
 
 
 
-  Last Published: 2013-09-02
+  Last Published: 2013-09-03
   
 
 

Modified: websites/staging/struts/trunk/content/announce-2003.html
==
--- websites/staging/struts/trunk/content/announce-2003.html (original)
+++ websites/staging/struts/trunk/content/announce-2003.html Tue Sep  3 
14:28:22 2013
@@ -1,13 +1,13 @@
 
 
 http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
   
 
 
-
+
 
 
 Announcements - 2003
@@ -54,7 +54,7 @@
 
 
 
-  Last Published: 2013-09-02
+  Last Published: 2013-09-03
   
 
 

Modified: websites/staging/struts/trunk/content/announce-2004.html
==
--- websites/staging/struts/trunk/content/announce-2004.html (original)
+++ websites/staging/struts/trunk/content/announce-2004.html Tue Sep  3 
14:28:22 2013
@@ -1,13 +1,13 @@
 
 
 http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
   
 
 
-
+
 
 
 Announcements - 2004
@@ -54,7 +54,7 @@
 
 
 
-  Last Published: 2013-09-02
+  Last Published: 2013-09-03
   
 
 

Modified: websites/staging/struts/trunk/content/announce-2005.html
==
--- websites/staging/struts/trunk/content/announce-2005.html (original)
+++ websites/staging/struts/trunk/content/announce-2005.html Tue Sep  3 
14:28:22 2013
@@ -1,13 +1,13 @@
 
 
 http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
   
 
 
-
+
 
 
 Announcements - 2005
@@ -54,7 +54,7 @@
 
 
 
-  Last Published: 2013-09-02
+  

svn commit: r1519812 - /struts/site/trunk/content/site.xml

2013-09-03 Thread grobmeier
Author: grobmeier
Date: Tue Sep  3 19:51:24 2013
New Revision: 1519812

URL: http://svn.apache.org/r1519812
Log:
removed outdated links

Modified:
struts/site/trunk/content/site.xml

Modified: struts/site/trunk/content/site.xml
URL: 
http://svn.apache.org/viewvc/struts/site/trunk/content/site.xml?rev=1519812&r1=1519811&r2=1519812&view=diff
==
--- struts/site/trunk/content/site.xml (original)
+++ struts/site/trunk/content/site.xml Tue Sep  3 19:51:24 2013
@@ -157,24 +157,6 @@
 />
 
 
-
-http://www.ApacheBookstore.com/";
-/>
-
-http://people.apache.org/~rubys/planet/struts/";
-/>
-
-http://struts.SourceForge.net/";
-/>
-
-
-
 
 
 Apache Struts, Struts, Apache, the Apache feather logo, and 
the Apache Struts




svn commit: r877186 - in /websites/staging/struts/trunk/content: ./ dev/

2013-09-03 Thread buildbot
Author: buildbot
Date: Tue Sep  3 19:52:55 2013
New Revision: 877186

Log:
Staging update by buildbot for struts

Modified:
websites/staging/struts/trunk/content/   (props changed)
websites/staging/struts/trunk/content/announce-2002.html
websites/staging/struts/trunk/content/announce-2003.html
websites/staging/struts/trunk/content/announce-2004.html
websites/staging/struts/trunk/content/announce-2005.html
websites/staging/struts/trunk/content/announce-2006.html
websites/staging/struts/trunk/content/announce-2007.html
websites/staging/struts/trunk/content/announce-2008.html
websites/staging/struts/trunk/content/announce-2009.html
websites/staging/struts/trunk/content/announce-2010.html
websites/staging/struts/trunk/content/announce-2011.html
websites/staging/struts/trunk/content/announce-2012.html
websites/staging/struts/trunk/content/announce.html
websites/staging/struts/trunk/content/dev/builds.html
websites/staging/struts/trunk/content/dev/bylaws.html
websites/staging/struts/trunk/content/dev/dev-mail.html
websites/staging/struts/trunk/content/dev/minutes.html
websites/staging/struts/trunk/content/dev/releases.html
websites/staging/struts/trunk/content/dev/site.html
websites/staging/struts/trunk/content/dev/volunteers.html
websites/staging/struts/trunk/content/download.html
websites/staging/struts/trunk/content/downloads.html
websites/staging/struts/trunk/content/faqs.html
websites/staging/struts/trunk/content/helping.html
websites/staging/struts/trunk/content/index.html
websites/staging/struts/trunk/content/javadoc.html
websites/staging/struts/trunk/content/kickstart.html
websites/staging/struts/trunk/content/mail.html
websites/staging/struts/trunk/content/primer.html
websites/staging/struts/trunk/content/release-checklist.html
websites/staging/struts/trunk/content/roadmap.html
websites/staging/struts/trunk/content/security.html
websites/staging/struts/trunk/content/struts1eol-announcement.html
websites/staging/struts/trunk/content/struts1eol-press.html

Propchange: websites/staging/struts/trunk/content/
--
--- cms:source-revision (original)
+++ cms:source-revision Tue Sep  3 19:52:55 2013
@@ -1 +1 @@
-1519696
+1519813

Modified: websites/staging/struts/trunk/content/announce-2002.html
==
--- websites/staging/struts/trunk/content/announce-2002.html (original)
+++ websites/staging/struts/trunk/content/announce-2002.html Tue Sep  3 
19:52:55 2013
@@ -272,28 +272,6 @@
   
 Source Repository
 
-  See Also
-
-  
-
-  http://www.ApacheBookstore.com/"; 
class="externalLink" title="Apache Bookstore">
-  
-Apache Bookstore
-
-  
-  
-
-  http://people.apache.org/~rubys/planet/struts/"; class="externalLink" 
title="Our Blogs">
-  
-Our Blogs
-
-  
-  
-
-  http://struts.SourceForge.net/"; 
class="externalLink" title="Struts SourceForge">
-  
-Struts SourceForge
-
 
 
 

Modified: websites/staging/struts/trunk/content/announce-2003.html
==
--- websites/staging/struts/trunk/content/announce-2003.html (original)
+++ websites/staging/struts/trunk/content/announce-2003.html Tue Sep  3 
19:52:55 2013
@@ -272,28 +272,6 @@
   
 Source Repository
 
-  See Also
-
-  
-
-  http://www.ApacheBookstore.com/"; 
class="externalLink" title="Apache Bookstore">
-  
-Apache Bookstore
-
-  
-  
-
-  http://people.apache.org/~rubys/planet/struts/"; class="externalLink" 
title="Our Blogs">
-  
-Our Blogs
-
-  
-  
-
-  http://struts.SourceForge.net/"; 
class="externalLink" title="Struts SourceForge">
-  
-Struts SourceForge
-
 
 
 

Modified: websites/staging/struts/trunk/content/announce-2004.html
==
--- websites/staging/struts/trunk/content/announce-2004.html (original)
+++ websites/staging/struts/trunk/content/announce-2004.html Tue Sep  3 
19:52:55 2013
@@ -272,28 +272,6 @@
   
 Source Repository
 
-  See Also
-
-  
-
-

[CONF] Confluence Changes in the last 24 hours

2013-09-03 Thread Anonymous (Confluence)







   Apache ActiveMQ


Pages

 Page:
 Source
edited by Dejan Bosanac[09:34 AM]
(view changes)



   Apache Ambari (Incubating)


Pages

 Blog post:
 Game 6 is in Los Angeles on Friday night and the Kings have won nine in a row at home, including the regular season
created by dgaw[02:59 AM]

 Blog post:
 Kinslers lined a game-winning single into the left-centre gap with one out in the 13th inning and the AL West-leading
created by dgaw[02:59 AM]

 Blog post:
 Justin Rose no longer has the lead all to himself at Bay Hill, though he remained four shots clear of
created by dgaw[02:57 AM]

 Blog post:
 Were still alive in this thing, and I think whats huge for us is having the whole day off to just rest the body and rest the mind," said Jacobs
created by dgaw[02:57 AM]

 Blog post:
 Former assistant football coach Mike McQueary sued the school in October, claiming he was portrayed as untruthful in
created by dgaw[02:57 AM]

 Blog post:
 This time, he was two shots behind, and hes lucky it wasnt more. Henley kept making birdies
created by dgaw[02:56 AM]



   Apache ActiveMQ CPP


Pages

 Page:
 ActiveMQ-CPP 3.8.0 Release
edited by Timothy Bish[10:38 PM]
(view changes)

 Page:
 Source
edited by Timothy Bish[09:38 PM]
(view changes)



   Apache BookKeeper


Pages

 Page:
 sdf Find fun coming from Cozily rrnside your current Jordan Slippers
created by ashley[12:45 AM]



   Apache Camel


Pages

 Page:
 Camel 2.12.0 Release
edited by Claus Ibsen[11:21 AM]
(view changes)

 Page:
 HTTP4
edited by Claus Ibsen[11:13 AM]
(view changes)



   Apache Cloudstack


Pages

 Page:
 How to build CloudStack
edited by Soheil Eizadi[08:52 PM]
(view changes)

 Page:
 Release test procedure
edited by Sebastien Goasguen[12:51 PM]
(view changes)

 Page:
 Useful Tips and Tricks
edited by Sailaja Mada[09:13 AM]
(view changes)



   Apache cTAKES


Pages

 Page:
 cTAKES 3.1 - Template Filler
edited by James Masanz[07:21 PM]
(view changes)

 

svn commit: r1519917 - in /struts/struts2/trunk: plugins/json/pom.xml pom.xml

2013-09-03 Thread lukaszlenart
Author: lukaszlenart
Date: Wed Sep  4 06:50:12 2013
New Revision: 1519917

URL: http://svn.apache.org/r1519917
Log:
Adds FEST assert to simplify testing

Modified:
struts/struts2/trunk/plugins/json/pom.xml
struts/struts2/trunk/pom.xml

Modified: struts/struts2/trunk/plugins/json/pom.xml
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/json/pom.xml?rev=1519917&r1=1519916&r2=1519917&view=diff
==
--- struts/struts2/trunk/plugins/json/pom.xml (original)
+++ struts/struts2/trunk/plugins/json/pom.xml Wed Sep  4 06:50:12 2013
@@ -97,5 +97,11 @@
 test
 
 
+
+org.easytesting
+fest-assert
+tewst
+
+
 
 

Modified: struts/struts2/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/pom.xml?rev=1519917&r1=1519916&r2=1519917&view=diff
==
--- struts/struts2/trunk/pom.xml (original)
+++ struts/struts2/trunk/pom.xml Wed Sep  4 06:50:12 2013
@@ -775,6 +775,13 @@
 
 
 
+org.easytesting
+fest-assert
+1.4
+test
+
+
+
 jmock
 jmock-cglib
 1.2.0




svn commit: r1519918 - in /struts/struts2/trunk/plugins/json/src/test: java/org/apache/struts2/json/JSONValidationInterceptorTest.java resources/org/apache/struts2/json/json-validation-1.txt

2013-09-03 Thread lukaszlenart
Author: lukaszlenart
Date: Wed Sep  4 06:51:05 2013
New Revision: 1519918

URL: http://svn.apache.org/r1519918
Log:
Modifies assertEquals on result to don't depend on order of validations

Removed:

struts/struts2/trunk/plugins/json/src/test/resources/org/apache/struts2/json/json-validation-1.txt
Modified:

struts/struts2/trunk/plugins/json/src/test/java/org/apache/struts2/json/JSONValidationInterceptorTest.java

Modified: 
struts/struts2/trunk/plugins/json/src/test/java/org/apache/struts2/json/JSONValidationInterceptorTest.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/json/src/test/java/org/apache/struts2/json/JSONValidationInterceptorTest.java?rev=1519918&r1=1519917&r2=1519918&view=diff
==
--- 
struts/struts2/trunk/plugins/json/src/test/java/org/apache/struts2/json/JSONValidationInterceptorTest.java
 (original)
+++ 
struts/struts2/trunk/plugins/json/src/test/java/org/apache/struts2/json/JSONValidationInterceptorTest.java
 Wed Sep  4 06:51:05 2013
@@ -41,6 +41,8 @@ import java.io.StringWriter;
 import java.util.HashMap;
 import java.util.Map;
 
+import static org.fest.assertions.Assertions.assertThat;
+
 public class JSONValidationInterceptorTest extends StrutsTestCase {
 
 private MockActionInvocation invocation;
@@ -66,10 +68,14 @@ public class JSONValidationInterceptorTe
 String json = stringWriter.toString();
 
 String normalizedActual = TestUtils.normalize(json, true);
-String normalizedExpected = TestUtils
-
.normalize(JSONValidationInterceptorTest.class.getResource("json-validation-1.txt"));
+
 //json
-assertEquals(normalizedExpected, normalizedActual);
+assertThat(normalizedActual)
+.contains("\"errors\":[\"Generalerror\"],")
+.contains("\"fieldErrors\":{")
+.contains("\"value\":[\"Minvalueis-1\"],")
+.contains("\"text\":[\"Tooshort\",\"Thisisnoemail\"]");
+
 //execution
 assertFalse(action.isExecuted());
 //http status




svn commit: r1519919 - in /struts/struts2/trunk/core/src: main/java/org/apache/struts2/views/util/DefaultUrlHelper.java test/java/org/apache/struts2/views/util/DefaultUrlHelperTest.java

2013-09-03 Thread lukaszlenart
Author: lukaszlenart
Date: Wed Sep  4 06:52:26 2013
New Revision: 1519919

URL: http://svn.apache.org/r1519919
Log:
Cleans up code, removes usage of ActionContext directly, uses @Inject instead

Modified:

struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java

struts/struts2/trunk/core/src/test/java/org/apache/struts2/views/util/DefaultUrlHelperTest.java

Modified: 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java?rev=1519919&r1=1519918&r2=1519919&view=diff
==
--- 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java
 (original)
+++ 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/util/DefaultUrlHelper.java
 Wed Sep  4 06:52:26 2013
@@ -21,16 +21,11 @@
 
 package org.apache.struts2.views.util;
 
-import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.inject.Container;
 import com.opensymphony.xwork2.inject.Inject;
-import com.opensymphony.xwork2.util.TextParseUtil;
-import com.opensymphony.xwork2.util.ValueStack;
 import com.opensymphony.xwork2.util.logging.Logger;
 import com.opensymphony.xwork2.util.logging.LoggerFactory;
 import org.apache.commons.lang3.StringEscapeUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.struts2.ServletActionContext;
 import org.apache.struts2.StrutsConstants;
 
 import javax.servlet.http.HttpServletRequest;
@@ -52,7 +47,12 @@ public class DefaultUrlHelper implements
 
 private static final Logger LOG = 
LoggerFactory.getLogger(DefaultUrlHelper.class);
 
+public static final String HTTP_PROTOCOL = "http";
+public static final String HTTPS_PROTOCOL = "https";
+
 private String encoding = "UTF-8";
+private int httpPort = DEFAULT_HTTP_PORT;
+private int httpsPort = DEFAULT_HTTPS_PORT;
 
 @Inject(StrutsConstants.STRUTS_I18N_ENCODING)
 public void setEncoding(String encoding) {
@@ -61,6 +61,16 @@ public class DefaultUrlHelper implements
 }
 }
 
+@Inject(StrutsConstants.STRUTS_URL_HTTP_PORT)
+public void setHttpPort(String httpPort) {
+this.httpPort = Integer.parseInt(httpPort);
+}
+
+@Inject(StrutsConstants.STRUTS_URL_HTTPS_PORT)
+public void setHttpsPort(String httpsPort) {
+this.httpsPort = Integer.parseInt(httpsPort);
+}
+
 public String buildUrl(String action, HttpServletRequest request, 
HttpServletResponse response, Map params) {
 return buildUrl(action, request, response, params, null, true, true);
 }
@@ -77,15 +87,10 @@ public class DefaultUrlHelper implements
 
 public String buildUrl(String action, HttpServletRequest request, 
HttpServletResponse response, Map params, String scheme,
boolean includeContext, boolean encodeResult, 
boolean forceAddSchemeHostAndPort, boolean escapeAmp) {
-StringBuilder link = new StringBuilder();
 
+StringBuilder link = new StringBuilder();
 boolean changedScheme = false;
 
-// FIXME: temporary hack until class is made a properly injected bean
-Container cont = ActionContext.getContext().getContainer();
-int httpPort = Integer.parseInt(cont.getInstance(String.class, 
StrutsConstants.STRUTS_URL_HTTP_PORT));
-int httpsPort = Integer.parseInt(cont.getInstance(String.class, 
StrutsConstants.STRUTS_URL_HTTPS_PORT));
-
 // only append scheme if it is different to the current scheme *OR*
 // if we explicity want it to be appended by having 
forceAddSchemeHostAndPort = true
 if (forceAddSchemeHostAndPort) {
@@ -98,31 +103,30 @@ public class DefaultUrlHelper implements
 if (scheme != null) {
 // If switching schemes, use the configured port for the 
particular scheme.
 if (!scheme.equals(reqScheme)) {
-if ((scheme.equals("http") && (httpPort != 
DEFAULT_HTTP_PORT)) || (scheme.equals("https") && httpsPort != 
DEFAULT_HTTPS_PORT)) {
+if ((HTTP_PROTOCOL.equals(scheme) && (httpPort != 
DEFAULT_HTTP_PORT)) || (HTTPS_PROTOCOL.equals(scheme) && httpsPort != 
DEFAULT_HTTPS_PORT)) {
 link.append(":");
-link.append(scheme.equals("http") ? httpPort : 
httpsPort);
+link.append(HTTP_PROTOCOL.equals(scheme) ? httpPort : 
httpsPort);
 }
 // Else use the port from the current request.
 } else {
 int reqPort = request.getServerPort();
 
-if ((scheme.equals("http") && (reqPort != 
DEFAULT_HTTP_PORT)) || (scheme.equals("https") && reqPort != 
DEFAULT_HTTPS_PORT)) {
+if ((scheme.equals(HTTP_PROTOCOL) && (reqPort !=