svn commit: r1076704 - in /struts/struts2/trunk: core/src/test/java/org/apache/struts2/ xwork-core/src/main/java/com/opensymphony/xwork2/ xwork-core/src/main/java/com/opensymphony/xwork2/validator/
Author: lukaszlenart Date: Thu Mar 3 17:48:32 2011 New Revision: 1076704 URL: http://svn.apache.org/viewvc?rev=1076704&view=rev Log: Solves WW-3547 - TextProvider.getText(String, List) changed to getText(String, List) Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/TestAction.java struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ActionSupport.java struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/CompositeTextProvider.java struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/DefaultTextProvider.java struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/TextProvider.java struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/TextProviderSupport.java struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/validator/DelegatingValidatorContext.java Modified: struts/struts2/trunk/core/src/test/java/org/apache/struts2/TestAction.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/test/java/org/apache/struts2/TestAction.java?rev=1076704&r1=1076703&r2=1076704&view=diff == --- struts/struts2/trunk/core/src/test/java/org/apache/struts2/TestAction.java (original) +++ struts/struts2/trunk/core/src/test/java/org/apache/struts2/TestAction.java Thu Mar 3 17:48:32 2011 @@ -73,7 +73,7 @@ public class TestAction extends ActionSu /** This is the method invoked by the {@link org.apache.struts2.util.TextProviderHelper}. * Returns the test value if defined otherwise delegates to the default TextProvider */ -public String getText(String key, String defaultValue, List args, ValueStack stack) { +public String getText(String key, String defaultValue, List args, ValueStack stack) { if (this.texts.containsKey(key)) { return this.texts.get(key); } else { Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ActionSupport.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ActionSupport.java?rev=1076704&r1=1076703&r2=1076704&view=diff == --- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ActionSupport.java (original) +++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ActionSupport.java Thu Mar 3 17:48:32 2011 @@ -108,7 +108,7 @@ public class ActionSupport implements Ac return getTextProvider().getText(aTextName, defaultValue, obj); } -public String getText(String aTextName, List args) { +public String getText(String aTextName, List args) { return getTextProvider().getText(aTextName, args); } @@ -116,7 +116,7 @@ public class ActionSupport implements Ac return getTextProvider().getText(key, args); } -public String getText(String aTextName, String defaultValue, List args) { +public String getText(String aTextName, String defaultValue, List args) { return getTextProvider().getText(aTextName, defaultValue, args); } @@ -124,7 +124,7 @@ public class ActionSupport implements Ac return getTextProvider().getText(key, defaultValue, args); } -public String getText(String key, String defaultValue, List args, ValueStack stack) { +public String getText(String key, String defaultValue, List args, ValueStack stack) { return getTextProvider().getText(key, defaultValue, args, stack); } Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/CompositeTextProvider.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/CompositeTextProvider.java?rev=1076704&r1=1076703&r2=1076704&view=diff == --- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/CompositeTextProvider.java (original) +++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/CompositeTextProvider.java Thu Mar 3 17:48:32 2011 @@ -111,7 +111,7 @@ public class CompositeTextProvider imple * @return * @see {@link com.opensymphony.xwork2.TextProvider#getText(String, java.util.List)} */ -public String getText(String key, List args) { +public String getText(String key, List args) { return getText(key, key, args); } @@ -139,7 +139,7 @@ public class CompositeTextProvider imple * @return * @see {@link com.opensymphony.xwork2.TextProvider#getText#getText(String, String, java.util.List)} */ -public String getText(String key, String defaultValue, List args) { +public String getText(String key, String defaultValue, List args) { // if there's one text provider that gives us a msg not the same as
[CONF] Confluence Changes in the last 24 hours
This is a daily summary of all recent changes in Confluence. - Updated Spaces: - Apache Camel (https://cwiki.apache.org/confluence/display/CAMEL) Pages - Camel 2.7.0 Release edited by davsclaus (12:10 PM) https://cwiki.apache.org/confluence/display/CAMEL/Camel+2.7.0+Release Camel Maven Archetypes edited by davsclaus (12:06 PM) https://cwiki.apache.org/confluence/display/CAMEL/Camel+Maven+Archetypes How to switch the CXF consumer between HTTP and HTTPS without touching the Spring configuration created by muellerc (04:19 AM) https://cwiki.apache.org/confluence/display/CAMEL/How+to+switch+the+CXF+consumer+between+HTTP+and+HTTPS+without+touching+the+Spring+configuration Team edited by rkettelerij (01:59 AM) https://cwiki.apache.org/confluence/display/CAMEL/Team Camel 2.7 - Roadmap edited by davsclaus (01:30 AM) https://cwiki.apache.org/confluence/display/CAMEL/Camel+2.7+-+Roadmap Apache Felix (https://cwiki.apache.org/confluence/display/FELIX) Pages - Board Report (2011-03) edited by gnodet (05:24 PM) https://cwiki.apache.org/confluence/display/FELIX/Board+Report+%282011-03%29 Apache Geronimo v3.0 (https://cwiki.apache.org/confluence/display/GMOxDOC30) Pages - Introducing Geronimo Administration Console edited by chirun...@gmail.com (10:27 PM) https://cwiki.apache.org/confluence/display/GMOxDOC30/Introducing+Geronimo+Administration+Console Apache OpenNLP (https://cwiki.apache.org/confluence/display/OPENNLP) Pages - TestPlan1.5.1 edited by joern (02:41 PM) https://cwiki.apache.org/confluence/display/OPENNLP/TestPlan1.5.1 Apache Shiro (https://cwiki.apache.org/confluence/display/SHIRO) Pages - Apache Shiro Video and Slide from SF JUG Presentation edited by skipshot4 (08:17 PM) https://cwiki.apache.org/confluence/display/SHIRO/2011/01/06/Apache+Shiro+Video+and+Slide+from+SF+JUG+Presentation Apache Shiro Support for Mule edited by skipshot4 (08:17 PM) https://cwiki.apache.org/confluence/display/SHIRO/2011/01/13/Apache+Shiro+Support+for+Mule Java Authorization Guide with Apache Shiro posted edited by skipshot4 (08:10 PM) https://cwiki.apache.org/confluence/display/SHIRO/2011/02/28/Java+Authorization+Guide+with+Apache+Shiro+posted Apache Shiro Integration for Grails 1.1.3 released edited by skipshot4 (08:10 PM) https://cwiki.apache.org/confluence/display/SHIRO/2011/02/09/Apache+Shiro+Integration+for+Grails+1.1.3+released sharing block-small created by skipshot4 (07:58 PM) https://cwiki.apache.org/confluence/display/SHIRO/sharing+block-small Apache ServiceMix (https://cwiki.apache.org/confluence/display/SM) Pages - ServiceMix 4.3.0 created by nanthrax (09:01 AM) https://cwiki.apache.org/confluence/display/SM/ServiceMix+4.3.0 ServiceMix 5 - NMR Improvements edited by gertvanthienen (03:10 AM) https://cwiki.apache.org/confluence/display/SM/ServiceMix+5+-+NMR+Improvements Apache Tapestry (https://cwiki.apache.org/confluence/display/TAPESTRY) Pages - Request Processing edited by drobiazko (05:00 AM) https://cwiki.apache.org/confluence/display/TAPESTRY/Request+Processing Traffic Server (https://cwiki.apache.org/confluence/display/TS) Pages - Projects edited by zwoop (12:18 PM) https://cwiki.apache.org/confluence/display/TS/Projects Apache VCL (https://cwiki.apache.org/confluence/display/VCL) Pages - VCL 2.2.1 Management Node Installation edited by arkurth (12:15 PM) https://cwiki.apache.org/confluence/display/VCL/VCL+2.2.1+Management+Node+Installation Apache Wicket (https://cwiki.apache.org/confluence/display/WICKET) Pages - Bookmarkable pages and links edited by co_tim (01:30 PM) https://cwiki.apache.org/confluence/display/WICKET/Bookmarkable+pages+and+links Apache Struts 2 Documentation (https://cwiki.apache.org/confluence/display/WW) Comments https://cwiki.apache.org/confluence/display/WW/JSON+Plugin (1) https://cwiki.apache.org/confluence/display/WW/Struts+2+JUnit+Plugin+Tutorial (1) Change your notification preferences: https://cwiki.apache.org/confluence/users/viewnotifications.action
svn commit: r1077832 - /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/LocalizedTextUtil.java
Author: lukaszlenart Date: Fri Mar 4 06:46:42 2011 New Revision: 1077832 URL: http://svn.apache.org/viewvc?rev=1077832&view=rev Log: Solves WW-3550 - LocalizedTextUtil's messageFormats property should be a ConcurrentHashMap and clears unneeded synchronize() blocks Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/LocalizedTextUtil.java Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/LocalizedTextUtil.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/LocalizedTextUtil.java?rev=1077832&r1=1077831&r2=1077832&view=diff == --- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/LocalizedTextUtil.java (original) +++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/LocalizedTextUtil.java Fri Mar 4 06:46:42 2011 @@ -28,7 +28,13 @@ import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.text.MessageFormat; -import java.util.*; +import java.util.Enumeration; +import java.util.List; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +import java.util.Set; +import java.util.TreeSet; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.CopyOnWriteArrayList; @@ -85,10 +91,10 @@ public class LocalizedTextUtil { private static boolean reloadBundles = false; private static final ResourceBundle EMPTY_BUNDLE = new EmptyResourceBundle(); private static final ConcurrentMap bundlesMap = new ConcurrentHashMap(); -private static final Map messageFormats = new HashMap(); +private static final ConcurrentMap messageFormats = new ConcurrentHashMap(); private static ClassLoader delegatedClassLoader; - + static { clearDefaultResourceBundles(); } @@ -242,27 +248,21 @@ public class LocalizedTextUtil { try { if (!bundlesMap.containsKey(key)) { -bundle = ResourceBundle.getBundle( -aBundleName, -locale, -Thread.currentThread().getContextClassLoader()); +bundle = ResourceBundle.getBundle(aBundleName, locale, Thread.currentThread().getContextClassLoader()); bundlesMap.put(key, bundle); } bundle = bundlesMap.get(key); } catch (MissingResourceException ex) { -if ( delegatedClassLoader != null) { +if (delegatedClassLoader != null) { try { if (!bundlesMap.containsKey(key)) { -bundle = ResourceBundle.getBundle( -aBundleName, -locale, -delegatedClassLoader); +bundle = ResourceBundle.getBundle(aBundleName, locale, delegatedClassLoader); bundlesMap.put(key, bundle); } bundle = bundlesMap.get(key); - + } catch (MissingResourceException e) { bundle = EMPTY_BUNDLE; bundlesMap.put(key, bundle); @@ -292,9 +292,7 @@ public class LocalizedTextUtil { * @param bundleName */ public static void clearBundle(final String bundleName) { -synchronized (bundlesMap) { -bundlesMap.remove(bundleName); -} +bundlesMap.remove(bundleName); } @@ -305,10 +303,7 @@ public class LocalizedTextUtil { * @param locale the locale. * @return the key to use for lookup/storing in the bundle misses cache. */ -private static String createMissesKey -(String -aBundleName, Locale -locale) { +private static String createMissesKey(String aBundleName, Locale locale) { return aBundleName + "_" + locale.toString(); } @@ -318,11 +313,7 @@ public class LocalizedTextUtil { * * @see #findText(Class aClass, String aTextName, Locale locale, String defaultMessage, Object[] args) */ -public static String findText -(Class -aClass, String -aTextName, Locale -locale) { +public static String findText(Class aClass, String aTextName, Locale locale) { return findText(aClass, aTextName, locale, aTextName, new Object[0]); } @@ -364,12 +355,7 @@ public class LocalizedTextUtil { * resource bundle * @return the localized text, or null if none can be found and no defaultMessage is provided */ -public static String findText -(Class -
svn commit: r1077833 - in /struts/struts2/trunk: core/src/main/java/org/apache/struts2/views/freemarker/ plugins/sitemesh/src/main/java/org/apache/struts2/sitemesh/
Author: lukaszlenart Date: Fri Mar 4 06:51:59 2011 New Revision: 1077833 URL: http://svn.apache.org/viewvc?rev=1077833&view=rev Log: Solves WW-3330 - <@s.action> broken in sitemesh freemarker decorator page Added: struts/struts2/trunk/plugins/sitemesh/src/main/java/org/apache/struts2/sitemesh/StrutsSiteMeshFactory.java Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java struts/struts2/trunk/plugins/sitemesh/src/main/java/org/apache/struts2/sitemesh/FreemarkerPageFilter.java Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java?rev=1077833&r1=1077832&r2=1077833&view=diff == --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java (original) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/freemarker/FreemarkerResult.java Fri Mar 4 06:51:59 2011 @@ -21,25 +21,11 @@ package org.apache.struts2.views.freemarker; -import java.io.CharArrayWriter; -import java.io.IOException; -import java.io.Writer; -import java.util.Locale; - -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.struts2.ServletActionContext; -import org.apache.struts2.dispatcher.StrutsResultSupport; -import org.apache.struts2.views.util.ResourceUtil; - import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.LocaleProvider; import com.opensymphony.xwork2.inject.Inject; import com.opensymphony.xwork2.util.ValueStack; - import freemarker.template.Configuration; import freemarker.template.ObjectWrapper; import freemarker.template.Template; @@ -47,6 +33,19 @@ import freemarker.template.TemplateExcep import freemarker.template.TemplateExceptionHandler; import freemarker.template.TemplateModel; import freemarker.template.TemplateModelException; +import org.apache.commons.lang.ObjectUtils; +import org.apache.struts2.ServletActionContext; +import org.apache.struts2.StrutsStatics; +import org.apache.struts2.dispatcher.StrutsResultSupport; +import org.apache.struts2.views.util.ResourceUtil; + +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.CharArrayWriter; +import java.io.IOException; +import java.io.Writer; +import java.util.Locale; /** @@ -330,11 +329,19 @@ public class FreemarkerResult extends St response.setContentType(contentType); } +} else if(isInsideActionTag()){ + //trigger com.opensymphony.module.sitemesh.filter.PageResponseWrapper.deactivateSiteMesh() +response.setContentType(response.getContentType()); } return true; } +private boolean isInsideActionTag() { +Object attribute = ServletActionContext.getRequest().getAttribute(StrutsStatics.STRUTS_ACTION_TAG_INVOCATION); +return (Boolean) ObjectUtils.defaultIfNull(attribute, Boolean.FALSE); +} + /** * @return true write to the stream only when template processing completed successfully (false by default) */ Modified: struts/struts2/trunk/plugins/sitemesh/src/main/java/org/apache/struts2/sitemesh/FreemarkerPageFilter.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/sitemesh/src/main/java/org/apache/struts2/sitemesh/FreemarkerPageFilter.java?rev=1077833&r1=1077832&r2=1077833&view=diff == --- struts/struts2/trunk/plugins/sitemesh/src/main/java/org/apache/struts2/sitemesh/FreemarkerPageFilter.java (original) +++ struts/struts2/trunk/plugins/sitemesh/src/main/java/org/apache/struts2/sitemesh/FreemarkerPageFilter.java Fri Mar 4 06:51:59 2011 @@ -21,34 +21,44 @@ package org.apache.struts2.sitemesh; -import com.opensymphony.sitemesh.webapp.SiteMeshWebAppContext; -import com.opensymphony.sitemesh.webapp.SiteMeshFilter; -import com.opensymphony.sitemesh.DecoratorSelector; -import com.opensymphony.module.sitemesh.Factory; import com.opensymphony.module.sitemesh.Config; +import com.opensymphony.module.sitemesh.Factory; +import com.opensymphony.sitemesh.DecoratorSelector; +import com.opensymphony.sitemesh.webapp.SiteMeshFilter; +import com.opensymphony.sitemesh.webapp.SiteMeshWebAppContext; import com.opensymphony.xwork2.inject.Inject; - -import javax.servlet.*; - import org.apache.struts2.views.freemarker.FreemarkerManager; +import javax.servlet.FilterConfig; +import javax.servlet.ServletContext; + /** * Core Filter for integrating SiteMesh + Freemarker into * a Java web appl