svn commit: r1492574 - /struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/logging/LoggerUtilsTest.java
Author: grobmeier Date: Thu Jun 13 08:51:05 2013 New Revision: 1492574 URL: http://svn.apache.org/r1492574 Log: testing expression enclosed by characters without space Modified: struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/logging/LoggerUtilsTest.java Modified: struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/logging/LoggerUtilsTest.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/logging/LoggerUtilsTest.java?rev=1492574&r1=1492573&r2=1492574&view=diff == --- struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/logging/LoggerUtilsTest.java (original) +++ struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/logging/LoggerUtilsTest.java Thu Jun 13 08:51:05 2013 @@ -13,7 +13,9 @@ public class LoggerUtilsTest extends Tes assertEquals("foo bob", LoggerUtils.format("foo #0", "bob")); assertEquals("foo bob joe", LoggerUtils.format("foo #0 #1", "bob", "joe")); assertEquals("foo bob joe #8", LoggerUtils.format("foo #0 #1 #8", "bob", "joe")); - +assertEquals("foo (bob/ally)", LoggerUtils.format("foo (#0/#1)", "bob", "ally")); +assertEquals("foo (bobally)", LoggerUtils.format("foo (#0#1)", "bob", "ally")); + assertEquals(null, LoggerUtils.format(null)); assertEquals("", LoggerUtils.format(""));
svn commit: r1492583 - /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java
Author: grobmeier Date: Thu Jun 13 09:05:35 2013 New Revision: 1492583 URL: http://svn.apache.org/r1492583 Log: used arguments in log statements, serial uid Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java?rev=1492583&r1=1492582&r2=1492583&view=diff == --- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java (original) +++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java Thu Jun 13 09:05:35 2013 @@ -85,6 +85,8 @@ import java.util.Map; * @author Aleksei Gopachenko */ public class I18nInterceptor extends AbstractInterceptor { +private static final long serialVersionUID = 2496830135246700300L; + protected static final Logger LOG = LoggerFactory.getLogger(I18nInterceptor.class); public static final String DEFAULT_SESSION_ATTRIBUTE = "WW_TRANS_I18N_LOCALE"; @@ -116,9 +118,8 @@ public class I18nInterceptor extends Abs @Override public String intercept(ActionInvocation invocation) throws Exception { if (LOG.isDebugEnabled()) { -LOG.debug("intercept '" -+ invocation.getProxy().getNamespace() + "/" -+ invocation.getProxy().getActionName() + "' { "); +LOG.debug("intercept '#0/#1' {", +invocation.getProxy().getNamespace(), invocation.getProxy().getActionName()); } //get requested locale Map params = invocation.getInvocationContext().getParameters(); @@ -140,7 +141,7 @@ public class I18nInterceptor extends Abs locale = (requested_locale instanceof Locale) ? (Locale) requested_locale : LocalizedTextUtil.localeFromString(requested_locale.toString(), null); if (locale != null && LOG.isDebugEnabled()) { -LOG.debug("applied request locale=" + locale); +LOG.debug("applied request locale=#0", locale); } } if (session != null) { @@ -152,13 +153,13 @@ public class I18nInterceptor extends Abs if (sessionLocale != null && sessionLocale instanceof Locale) { locale = (Locale) sessionLocale; if (LOG.isDebugEnabled()) { -LOG.debug("applied session locale=" + locale); +LOG.debug("applied session locale=#0", locale); } } else { // no overriding locale definition found, stay with current invocation (=browser) locale locale = invocation.getInvocationContext().getLocale(); if (locale != null && LOG.isDebugEnabled()) { -LOG.debug("applied invocation context locale=" + locale); +LOG.debug("applied invocation context locale=#0", locale); } } } @@ -170,12 +171,12 @@ public class I18nInterceptor extends Abs saveLocale(invocation, locale); if (LOG.isDebugEnabled()) { -LOG.debug("before Locale=" + invocation.getStack().findValue("locale")); +LOG.debug("before Locale=#0", invocation.getStack().findValue("locale")); } final String result = invocation.invoke(); if (LOG.isDebugEnabled()) { -LOG.debug("after Locale=" + invocation.getStack().findValue("locale")); +LOG.debug("after Locale=#0", invocation.getStack().findValue("locale")); } if (LOG.isDebugEnabled()) { @@ -192,7 +193,7 @@ public class I18nInterceptor extends Abs requested_locale = ((Object[]) requested_locale)[0]; if (LOG.isDebugEnabled()) { -LOG.debug("requested_locale=" + requested_locale); +LOG.debug("requested_locale=#0", requested_locale); } } return requested_locale;
svn commit: r1492613 - /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java
Author: grobmeier Date: Thu Jun 13 10:30:31 2013 New Revision: 1492613 URL: http://svn.apache.org/r1492613 Log: removed unnecessary if Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java?rev=1492613&r1=1492612&r2=1492613&view=diff == --- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java (original) +++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java Thu Jun 13 10:30:31 2013 @@ -177,9 +177,6 @@ public class I18nInterceptor extends Abs final String result = invocation.invoke(); if (LOG.isDebugEnabled()) { LOG.debug("after Locale=#0", invocation.getStack().findValue("locale")); -} - -if (LOG.isDebugEnabled()) { LOG.debug("intercept } "); }
svn commit: r1492624 - /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java
Author: grobmeier Date: Thu Jun 13 11:21:20 2013 New Revision: 1492624 URL: http://svn.apache.org/r1492624 Log: renamed local variable to remove underscore Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java?rev=1492624&r1=1492623&r2=1492624&view=diff == --- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java (original) +++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java Thu Jun 13 11:21:20 2013 @@ -125,10 +125,10 @@ public class I18nInterceptor extends Abs Map params = invocation.getInvocationContext().getParameters(); boolean storeInSession = true; -Object requested_locale = findLocaleParameter(params, parameterName); -if (requested_locale == null) { -requested_locale = findLocaleParameter(params, requestOnlyParameterName); -if (requested_locale != null) { +Object requestedLocale = findLocaleParameter(params, parameterName); +if (requestedLocale == null) { +requestedLocale = findLocaleParameter(params, requestOnlyParameterName); +if (requestedLocale != null) { storeInSession = false; } } @@ -137,9 +137,9 @@ public class I18nInterceptor extends Abs Map session = invocation.getInvocationContext().getSession(); Locale locale = null; -if (requested_locale != null) { -locale = (requested_locale instanceof Locale) ? -(Locale) requested_locale : LocalizedTextUtil.localeFromString(requested_locale.toString(), null); +if (requestedLocale != null) { +locale = (requestedLocale instanceof Locale) ? +(Locale) requestedLocale : LocalizedTextUtil.localeFromString(requestedLocale.toString(), null); if (locale != null && LOG.isDebugEnabled()) { LOG.debug("applied request locale=#0", locale); } @@ -184,16 +184,16 @@ public class I18nInterceptor extends Abs } private Object findLocaleParameter(Map params, String parameterName) { -Object requested_locale = params.remove(parameterName); -if (requested_locale != null && requested_locale.getClass().isArray() -&& ((Object[]) requested_locale).length == 1) { -requested_locale = ((Object[]) requested_locale)[0]; +Object requestedLocale = params.remove(parameterName); +if (requestedLocale != null && requestedLocale.getClass().isArray() +&& ((Object[]) requestedLocale).length == 1) { +requestedLocale = ((Object[]) requestedLocale)[0]; if (LOG.isDebugEnabled()) { -LOG.debug("requested_locale=#0", requested_locale); +LOG.debug("requested_locale=#0", requestedLocale); } } -return requested_locale; +return requestedLocale; } /**
svn commit: r1492633 - /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java
Author: grobmeier Date: Thu Jun 13 11:57:16 2013 New Revision: 1492633 URL: http://svn.apache.org/r1492633 Log: some refactorings for better readability Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java?rev=1492633&r1=1492632&r2=1492633&view=diff == --- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java (original) +++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java Thu Jun 13 11:57:16 2013 @@ -125,6 +125,7 @@ public class I18nInterceptor extends Abs Map params = invocation.getInvocationContext().getParameters(); boolean storeInSession = true; + Object requestedLocale = findLocaleParameter(params, parameterName); if (requestedLocale == null) { requestedLocale = findLocaleParameter(params, requestOnlyParameterName); @@ -133,41 +134,24 @@ public class I18nInterceptor extends Abs } } +Locale locale = getLocaleFromParam(requestedLocale); + //save it in session Map session = invocation.getInvocationContext().getSession(); -Locale locale = null; -if (requestedLocale != null) { -locale = (requestedLocale instanceof Locale) ? -(Locale) requestedLocale : LocalizedTextUtil.localeFromString(requestedLocale.toString(), null); -if (locale != null && LOG.isDebugEnabled()) { -LOG.debug("applied request locale=#0", locale); -} -} if (session != null) { synchronized (session) { if (locale == null) { storeInSession = false; -// check session for saved locale -Object sessionLocale = session.get(attributeName); -if (sessionLocale != null && sessionLocale instanceof Locale) { -locale = (Locale) sessionLocale; -if (LOG.isDebugEnabled()) { -LOG.debug("applied session locale=#0", locale); -} -} else { -// no overriding locale definition found, stay with current invocation (=browser) locale -locale = invocation.getInvocationContext().getLocale(); -if (locale != null && LOG.isDebugEnabled()) { -LOG.debug("applied invocation context locale=#0", locale); -} -} +locale = readStoredLocale(invocation, session); } + if (storeInSession) { session.put(attributeName, locale); } } } + saveLocale(invocation, locale); if (LOG.isDebugEnabled()) { @@ -183,6 +167,54 @@ public class I18nInterceptor extends Abs return result; } +/** + * Reads the locale from the session, and if not found from the + * current invocation (=browser) + * + * @param invocation the current invocation + * @param session the current session + * @return the read locale + */ +private Locale readStoredLocale(ActionInvocation invocation, Map session) { +// check session for saved locale +Object sessionLocale = session.get(attributeName); +if (sessionLocale != null && sessionLocale instanceof Locale) { +Locale locale = (Locale) sessionLocale; +if (LOG.isDebugEnabled()) { +LOG.debug("applied session locale=#0", locale); +} +return locale; +} + +// no overriding locale definition found, stay with current invocation (=browser) locale +Locale locale = invocation.getInvocationContext().getLocale(); +if (locale != null && LOG.isDebugEnabled()) { +LOG.debug("applied invocation context locale=#0", locale); +} + +return locale; +} + +/** + * Creates a Locale object from the request param, which might + * be already a Local or a String + * + * @param requestedLocale the parameter from the request + * @return the Locale + */ +private Locale getLocaleFromParam(Object requestedLocale) { +Locale locale = null; +if (requestedLocale != null) { +locale = (requestedLocale instanceof Locale) ? +(Locale) requestedLocale : + LocalizedTextUtil.localeFromString(requestedLocale.toString(), nul
svn commit: r1492644 - /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java
Author: grobmeier Date: Thu Jun 13 12:36:34 2013 New Revision: 1492644 URL: http://svn.apache.org/r1492644 Log: made private methods protected Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java Modified: struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java?rev=1492644&r1=1492643&r2=1492644&view=diff == --- struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java (original) +++ struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/I18nInterceptor.java Thu Jun 13 12:36:34 2013 @@ -175,7 +175,7 @@ public class I18nInterceptor extends Abs * @param session the current session * @return the read locale */ -private Locale readStoredLocale(ActionInvocation invocation, Map session) { +protected Locale readStoredLocale(ActionInvocation invocation, Map session) { // check session for saved locale Object sessionLocale = session.get(attributeName); if (sessionLocale != null && sessionLocale instanceof Locale) { @@ -202,7 +202,7 @@ public class I18nInterceptor extends Abs * @param requestedLocale the parameter from the request * @return the Locale */ -private Locale getLocaleFromParam(Object requestedLocale) { +protected Locale getLocaleFromParam(Object requestedLocale) { Locale locale = null; if (requestedLocale != null) { locale = (requestedLocale instanceof Locale) ?
svn commit: r865589 - /websites/production/struts/content/development/2.x/docs/struts-next.html
Author: lukaszlenart Date: Thu Jun 13 19:03:37 2013 New Revision: 865589 Log: Updates draft docs Modified: websites/production/struts/content/development/2.x/docs/struts-next.html Modified: websites/production/struts/content/development/2.x/docs/struts-next.html == --- websites/production/struts/content/development/2.x/docs/struts-next.html (original) +++ websites/production/struts/content/development/2.x/docs/struts-next.html Thu Jun 13 19:03:37 2013 @@ -149,7 +149,6 @@ under the License. Refactor conversion of primitives (and wrappers) in XWork Switch to http://commons.apache.org/ognl"; class="external-link" rel="nofollow">OGNL 4.0. - Adopt http://www.slf4j.org/"; class="external-link" rel="nofollow">slf4j as new logging framework: this allows developers to plug-in any logging framework they want. Consider renaming packages to org.apache.struts3 Remove deprecated Plugins
svn commit: r865590 - in /websites/production/struts/content: ./ development/ release/
Author: lukaszlenart Date: Thu Jun 13 19:04:13 2013 New Revision: 865590 Log: Push changes Added: websites/production/struts/content/ - copied from r865589, websites/staging/struts/trunk/content/ websites/production/struts/content/development/ - copied from r865589, websites/production/struts/content/development/ websites/production/struts/content/release/ - copied from r865589, websites/production/struts/content/release/
svn commit: r865591 - in /websites/production/struts/content/development/2.x/docs: cookieprovider-interceptor.html interceptors.html
Author: lukaszlenart Date: Thu Jun 13 19:10:03 2013 New Revision: 865591 Log: Updates draft docs Modified: websites/production/struts/content/development/2.x/docs/cookieprovider-interceptor.html websites/production/struts/content/development/2.x/docs/interceptors.html Modified: websites/production/struts/content/development/2.x/docs/cookieprovider-interceptor.html == --- websites/production/struts/content/development/2.x/docs/cookieprovider-interceptor.html (original) +++ websites/production/struts/content/development/2.x/docs/cookieprovider-interceptor.html Thu Jun 13 19:10:03 2013 @@ -123,16 +123,32 @@ under the License. - Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20 + Allows actions to send cookies to client, action must implement CookieProvider +You must reference this interceptor in your default stack or in action's stack, see example below. Parameters -Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20 + +none + Extending the Interceptor -Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20 + + +addCookiesToResponse - this method applies cookie created by action to response + + Examples -Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20 + + ++ + + + Modified: websites/production/struts/content/development/2.x/docs/interceptors.html == --- websites/production/struts/content/development/2.x/docs/interceptors.html (original) +++ websites/production/struts/content/development/2.x/docs/interceptors.html Thu Jun 13 19:10:03 2013 @@ -367,6 +367,7 @@ under the License.+ + ... + + @@ -982,6 +983,9 @@ thisWillRunFirstInterceptor Multiselect Interceptor (Apache Struts 2 Documentation) + CookieProvider Interceptor + (Apache Struts 2 Documentation) +
svn commit: r865593 - in /websites/production/struts/content: ./ development/ release/
Author: lukaszlenart Date: Thu Jun 13 19:10:47 2013 New Revision: 865593 Log: Push changes Added: websites/production/struts/content/ - copied from r865592, websites/staging/struts/trunk/content/ websites/production/struts/content/development/ - copied from r865592, websites/production/struts/content/development/ websites/production/struts/content/release/ - copied from r865592, websites/production/struts/content/release/
[CONF] Confluence Changes in the last 24 hours
This is a daily summary of all recent changes in Confluence. - Updated Spaces: - Apache Open Climate Workbench (https://cwiki.apache.org/confluence/display/CLIMATE) Pages - Open Climate Workbench API summary edited by boustani (01:30 PM) https://cwiki.apache.org/confluence/display/CLIMATE/Open+Climate+Workbench+API+summary Apache Cloudstack (https://cwiki.apache.org/confluence/display/CLOUDSTACK) Pages - Hack Day at CCC13 created by jzb (02:02 PM) https://cwiki.apache.org/confluence/display/CLOUDSTACK/Hack+Day+at+CCC13 Scaling-up CPU and RAM for running VMs edited by prashantkm (09:11 AM) https://cwiki.apache.org/confluence/display/CLOUDSTACK/Scaling-up+CPU+and+RAM+for+running+VMs Apache Kafka (https://cwiki.apache.org/confluence/display/KAFKA) Comments https://cwiki.apache.org/confluence/display/KAFKA/Kafka+0.8+Quick+Start (2) Apache Mesos (https://cwiki.apache.org/confluence/display/MESOS) Pages - Index edited by andyk (02:30 PM) https://cwiki.apache.org/confluence/display/MESOS/Index OFBiz Project Administration Workspace (https://cwiki.apache.org/confluence/display/OFBADMIN) Pages - A New Application Framework Design edited by adrianc (08:34 AM) https://cwiki.apache.org/confluence/display/OFBADMIN/A+New+Application+Framework+Design OFBiz (Open For Business) Project Open Wiki (https://cwiki.apache.org/confluence/display/OFBIZ) Pages - Apache OFBiz Service Providers edited by ni...@sarathisolutions.com (02:02 PM) https://cwiki.apache.org/confluence/display/OFBIZ/Apache+OFBiz+Service+Providers Apache OFBiz User List edited by dagarwal (03:23 AM) https://cwiki.apache.org/confluence/display/OFBIZ/Apache+OFBiz+User+List Comments https://cwiki.apache.org/confluence/display/OFBIZ/OFBiz+Tutorial+-+A+Beginners+Development+Guide (1) Apache OpenOffice Community (https://cwiki.apache.org/confluence/display/OOOUSERS) Pages - Localization Volunteers edited by amit (09:28 PM) https://cwiki.apache.org/confluence/display/OOOUSERS/Localization+Volunteers Development Snapshot Builds edited by jsc (10:46 AM) https://cwiki.apache.org/confluence/display/OOOUSERS/Development+Snapshot+Builds Apache Qpid (https://cwiki.apache.org/confluence/display/qpid) Pages - 0.24 Release edited by justi9 (01:44 PM) https://cwiki.apache.org/confluence/display/qpid/0.24+Release 0.22 Release edited by justi9 (01:37 PM) https://cwiki.apache.org/confluence/display/qpid/0.22+Release Traffic Server (https://cwiki.apache.org/confluence/display/TS) Pages - What's new in v3.4 edited by zwoop (01:59 PM) https://cwiki.apache.org/confluence/display/TS/What%27s+new+in+v3.4 Apache Wicket (https://cwiki.apache.org/confluence/display/WICKET) Pages - Migration to Wicket 7.0 edited by svenmeier (04:09 PM) https://cwiki.apache.org/confluence/display/WICKET/Migration+to+Wicket+7.0 Apache Struts 2 Documentation (https://cwiki.apache.org/confluence/display/WW) Pages - CookieProvider Interceptor edited by lukaszlenart (03:07 PM) https://cwiki.apache.org/confluence/display/WW/CookieProvider+Interceptor Change your notification preferences: https://cwiki.apache.org/confluence/users/viewnotifications.action