You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by th...@apache.org on 2023/05/07 20:16:47 UTC
[tapestry-5] branch better-page-invalidation updated: TAP5-2742: forces pages to never rendered from the unknwon context
This is an automated email from the ASF dual-hosted git repository.
thiagohp pushed a commit to branch better-page-invalidation
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git
The following commit(s) were added to refs/heads/better-page-invalidation by this push:
new 55974ba85 TAP5-2742: forces pages to never rendered from the unknwon context
55974ba85 is described below
commit 55974ba85c66f9bd486490e1dc06883eecdd1c41
Author: Thiago H. de Paula Figueiredo <th...@arsmachina.com.br>
AuthorDate: Sun May 7 17:16:35 2023 -0300
TAP5-2742: forces pages to never rendered from the unknwon context
---
.../internal/services/PageSourceImpl.java | 10 ++++++++--
.../apache/tapestry5/modules/TapestryModule.java | 22 ----------------------
2 files changed, 8 insertions(+), 24 deletions(-)
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageSourceImpl.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageSourceImpl.java
index ff15ab7a7..afcb51fdb 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageSourceImpl.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PageSourceImpl.java
@@ -168,8 +168,14 @@ public class PageSourceImpl implements PageSource
componentDependencyRegistry.clear(rootElement);
componentDependencyRegistry.register(rootElement);
context = pageClassloaderContextManager.get(className);
- pageClassloaderContextManager.get(className);
-
+ if (context.isUnknown())
+ {
+ componentDependencyRegistry.disableInvalidations();
+ pageClassloaderContextManager.invalidateAndFireInvalidationEvents(context);
+ componentDependencyRegistry.enableInvalidations();
+ pageClassloaderContextManager.get(className);
+ return getPage(canonicalPageName);
+ }
}
}
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/modules/TapestryModule.java b/tapestry-core/src/main/java/org/apache/tapestry5/modules/TapestryModule.java
index 045c68173..5c57f9e57 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/modules/TapestryModule.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/modules/TapestryModule.java
@@ -1013,28 +1013,6 @@ public final class TapestryModule
configuration.addInstance("ErrorFilter", RequestErrorFilter.class);
- if (!productionMode)
- {
-
- // TODO: change this to only invalidate the current page
- RequestFilter invalidateUnknownContext = new RequestFilter()
- {
- public boolean service(Request request, Response response, RequestHandler handler) throws IOException
- {
- try
- {
- return handler.service(request, response);
- } finally
- {
- pageClassloaderContextManager.invalidateUnknownContext();
- }
- }
- };
-
- configuration.add(PageClassloaderContextManager.class.getName(),
- invalidateUnknownContext, "before:EndOfRequest");
- }
-
}
/**