Author: bleny Date: 2013-04-18 16:46:31 +0200 (Thu, 18 Apr 2013) New Revision: 115 Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revisions... Log: print session messages Modified: trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/MagalieInterceptor.java Modified: trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/MagalieInterceptor.java =================================================================== --- trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/MagalieInterceptor.java 2013-04-18 13:17:39 UTC (rev 114) +++ trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/MagalieInterceptor.java 2013-04-18 14:46:31 UTC (rev 115) @@ -31,6 +31,7 @@ import com.google.common.base.Preconditions; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.interceptor.Interceptor; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.struts2.StrutsStatics; @@ -80,6 +81,20 @@ } + MagalieSession magalieSession = getMagalieSession(invocation); + + if (CollectionUtils.isNotEmpty(magalieSession.getMessages())) { + + for (String message : magalieSession.getMessages()) { + + ((MagalieActionSupport) action).addActionMessage(message); + + } + + magalieSession.getMessages().clear(); + + } + for (PropertyDescriptor propertyDescriptor : descriptors) { Class<?> propertyType = propertyDescriptor.getPropertyType(); @@ -95,7 +110,7 @@ } else if (MagalieSession.class.isAssignableFrom(propertyType)) { - toInject = getMagalieSession(invocation); + toInject = magalieSession; } else if (MagalieApplicationConfig.class.isAssignableFrom(propertyType)) {
participants (1)
-
bleny@users.forge.codelutin.com