tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mluse...@apache.org
Subject [5/8] git commit: TAP5-2070 better to take no activation handler method as a way to accept empty activation context
Date Mon, 05 Aug 2013 17:48:37 GMT
TAP5-2070 better to take no activation handler method as a way to accept empty activation context


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/28e3321f
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/28e3321f
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/28e3321f

Branch: refs/heads/master
Commit: 28e3321f7865fb74cd36c78f3911bfbd9750ae77
Parents: 8d24cbd
Author: Massimo Lusetti <mlusetti@apache.org>
Authored: Mon Aug 5 18:17:02 2013 +0200
Committer: Massimo Lusetti <mlusetti@apache.org>
Committed: Mon Aug 5 19:48:15 2013 +0200

----------------------------------------------------------------------
 .../apache/tapestry5/internal/services/PageActivatorImpl.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/28e3321f/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageActivatorImpl.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageActivatorImpl.java
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageActivatorImpl.java
index 3b7742b..5ebdc7c 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageActivatorImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageActivatorImpl.java
@@ -50,10 +50,14 @@ public class PageActivatorImpl implements PageActivator
 
 		boolean handled = pageResources.triggerContextEvent(EventConstants.ACTIVATE, activationContext,
callback);
 
+		boolean acceptEmpty = !pageResources.getComponentModel().handlesEvent(EventConstants.ACTIVATE)
&&
+								activationContext.getCount() == 0;
+
 		boolean checkUnknown = metaDataLocator.findMeta(MetaDataConstants.UNKNOWN_ACTIVATION_CONTEXT_CHECK,
 														pageResources, Boolean.class);
 
-		if ( !handled && checkUnknown && !pageResources.getComponentModel().handleActivationEventContext())
+		if ( !handled && !acceptEmpty && checkUnknown &&
+				!pageResources.getComponentModel().handleActivationEventContext())
 		{
 			logger.info("Page {} required an exact activation context, let's handle this", pageResources.getPageName());
 			unknownActivationContextHandler.handleUnknownContext(pageResources, activationContext);


Mime
View raw message