Author: hlship Date: Sun Nov 20 07:54:24 2005 New Revision: 345753 URL: http://svn.apache.org/viewcvs?rev=345753&view=rev Log: TAPESTRY-763: RequestCycle is not available during page initialization
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/RequestCycle.java jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pageload/PageLoader.java jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pageload/PageSource.java jakarta/tapestry/trunk/status.xml Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/RequestCycle.java URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/RequestCycle.java?rev=345753&r1=345752&r2=345753&view=diff ============================================================================== --- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/RequestCycle.java (original) +++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/RequestCycle.java Sun Nov 20 07:54:24 2005 @@ -283,11 +283,6 @@ result.setChangeObserver(recorder); - // Now that persistent properties have been restored, we can - // attach the page to this request. - - result.attach(_engine, this); - return result; } finally Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pageload/PageLoader.java URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pageload/PageLoader.java?rev=345753&r1=345752&r2=345753&view=diff ============================================================================== --- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pageload/PageLoader.java (original) +++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pageload/PageLoader.java Sun Nov 20 07:54:24 2005 @@ -606,6 +606,11 @@ { page = instantiatePage(name, namespace, specification); + // The page is now attached to the engine and request cycle; some code + // inside the page's finishLoad() method may require this. TAPESTRY-763 + + page.attach(cycle.getEngine(), cycle); + constructComponent(cycle, page, page, specification, namespace); // Walk through the complete component tree to set up the default Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pageload/PageSource.java URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pageload/PageSource.java?rev=345753&r1=345752&r2=345753&view=diff ============================================================================== --- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pageload/PageSource.java (original) +++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pageload/PageSource.java Sun Nov 20 07:54:24 2005 @@ -36,7 +36,7 @@ * the pool using [EMAIL PROTECTED] #releasePage(IPage)}. * <p> * TBD: Pooled pages stay forever. Need a strategy for cleaning up the pool, tracking which pages - * have been in the pool the longest, etc. + * have been in the pool the longest, etc. * * @author Howard Lewis Ship */ @@ -114,6 +114,8 @@ _pageSpecificationResolver.resolve(cycle, pageName); + // The loader is responsible for invoking attach() + result = _loader.loadPage( _pageSpecificationResolver.getSimplePageName(), _pageSpecificationResolver.getNamespace(), @@ -121,6 +123,12 @@ _pageSpecificationResolver.getSpecification()); monitor.pageCreateEnd(pageName); + } + else + { + // But for pooled pages, we are responsible + + result.attach(engine, cycle); } return result; Modified: jakarta/tapestry/trunk/status.xml URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/status.xml?rev=345753&r1=345752&r2=345753&view=diff ============================================================================== --- jakarta/tapestry/trunk/status.xml (original) +++ jakarta/tapestry/trunk/status.xml Sun Nov 20 07:54:24 2005 @@ -60,6 +60,7 @@ <action type="update" dev="HLS">Make the logic for localizing resources extensible</action> <action type="update" dev="HLS">More work on the QuickStart documentation</action> <action type="fix" dev="HLS" fixes-bug="TAPESTRY-759">Body.get(cycle) throws exception</action> + <action type="fix" dev="HLS" fixes-bug="TAPESTRY-763">RequestCycle is not available during page initialization</action> </release> <release version="4.0-beta-13" date="Nov 12 2005"> <action type="update" dev="HLS">Switch to HiveMind 1.1 (final)</action> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]