Return-Path: Delivered-To: apmail-tapestry-dev-archive@www.apache.org Received: (qmail 67351 invoked from network); 31 Dec 2009 16:51:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Dec 2009 16:51:33 -0000 Received: (qmail 97345 invoked by uid 500); 31 Dec 2009 16:51:33 -0000 Delivered-To: apmail-tapestry-dev-archive@tapestry.apache.org Received: (qmail 97284 invoked by uid 500); 31 Dec 2009 16:51:33 -0000 Mailing-List: contact commits-help@tapestry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tapestry.apache.org Delivered-To: mailing list commits@tapestry.apache.org Received: (qmail 97275 invoked by uid 99); 31 Dec 2009 16:51:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Dec 2009 16:51:33 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Dec 2009 16:51:31 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C96D123889CB; Thu, 31 Dec 2009 16:51:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r894887 - in /tapestry/tapestry5/trunk: src/site/apt/ src/site/apt/guide/ tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/ tapestry-core/src/main/resources/org/apache/tapestry5/internal/structure/ Date: Thu, 31 Dec 2009 16:51:09 -0000 To: commits@tapestry.apache.org From: drobiazko@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091231165109.C96D123889CB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: drobiazko Date: Thu Dec 31 16:51:08 2009 New Revision: 894887 URL: http://svn.apache.org/viewvc?rev=894887&view=rev Log: TAP5-823: Message about incompatible return type of a render phase method is misleading Modified: tapestry/tapestry5/trunk/src/site/apt/guide/rendering.apt tapestry/tapestry5/trunk/src/site/apt/index.apt tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/RenderPhaseEventHandler.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/StructureMessages.java tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/structure/StructureStrings.properties Modified: tapestry/tapestry5/trunk/src/site/apt/guide/rendering.apt URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/src/site/apt/guide/rendering.apt?rev=894887&r1=894886&r2=894887&view=diff ============================================================================== --- tapestry/tapestry5/trunk/src/site/apt/guide/rendering.apt (original) +++ tapestry/tapestry5/trunk/src/site/apt/guide/rendering.apt Thu Dec 31 16:51:08 2009 @@ -276,6 +276,31 @@ Returning a component instance does <> short circuit method invocation, the way returning a boolean would. It is possible that multiple methods may return components (this is not advised -- insanity may ensue). + +Further Return Types + + Further return types for a render phase method are {{{../apidocs/org/apache/tapestry5/Block.html}Block}}, + {{{../apidocs/org/apache/tapestry5/Renderable.html}Renderable}} and {{{../apidocs/org/apache/tapestry5/runtime/RenderCommand.html}RenderCommand}}. + The following component returns a Renderable in the early phase BeginRender and skips the phase BeforeRenderTemplate. + ++---+ +public class OutputValueComponent +{ + @Paremeter + private String value; + + Object beginRender() + { + return new Renderable() + { + public void render(MarkupWriter writer) + { + writer.write(value); + } + }; + } + } ++---+ Method Conflicts and Ordering Modified: tapestry/tapestry5/trunk/src/site/apt/index.apt URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/src/site/apt/index.apt?rev=894887&r1=894886&r2=894887&view=diff ============================================================================== --- tapestry/tapestry5/trunk/src/site/apt/index.apt (original) +++ tapestry/tapestry5/trunk/src/site/apt/index.apt Thu Dec 31 16:51:08 2009 @@ -35,6 +35,10 @@ New And Of Note * A {{{guide/testing.html}guide to integration testing}} is now available. + + * The annotated {{{guide/persist.html}@SessionAttribute}} can be used to read or to write some data from or into the HttpSession. + + * The {{{tapestry-beanvalidator}JSR-303 Integration Library}} is now available. [] Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/RenderPhaseEventHandler.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/RenderPhaseEventHandler.java?rev=894887&r1=894886&r2=894887&view=diff ============================================================================== --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/RenderPhaseEventHandler.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/RenderPhaseEventHandler.java Thu Dec 31 16:51:08 2009 @@ -14,6 +14,9 @@ package org.apache.tapestry5.internal.structure; +import java.util.Arrays; +import java.util.List; + import org.apache.tapestry5.ComponentEventCallback; import org.apache.tapestry5.MarkupWriter; import org.apache.tapestry5.Renderable; @@ -21,8 +24,6 @@ import org.apache.tapestry5.runtime.RenderCommand; import org.apache.tapestry5.runtime.RenderQueue; -import java.util.List; - /** * Used by {@link org.apache.tapestry5.internal.structure.ComponentPageElementImpl} to track the results of invoking the * component methods for a render phase event. @@ -81,7 +82,8 @@ return false; } - throw new RuntimeException(StructureMessages.wrongPhaseResultType(Boolean.class)); + throw new RuntimeException(StructureMessages.wrongPhaseResultType( + Arrays.asList(Boolean.class.getName(), Renderable.class.getName(), RenderCommand.class.getName()))); } private void add(RenderCommand command) Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/StructureMessages.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/StructureMessages.java?rev=894887&r1=894886&r2=894887&view=diff ============================================================================== --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/StructureMessages.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/structure/StructureMessages.java Thu Dec 31 16:51:08 2009 @@ -65,9 +65,9 @@ return MESSAGES.format("detach-failure", listener, cause); } - static String wrongPhaseResultType(Class expectedType) + static String wrongPhaseResultType(List expectedTypes) { - return MESSAGES.format("wrong-phase-result-type", expectedType.getName()); + return MESSAGES.format("wrong-phase-result-type", InternalUtils.join(expectedTypes)); } static String blockNotFound(String componentId, String blockId) Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/structure/StructureStrings.properties URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/structure/StructureStrings.properties?rev=894887&r1=894886&r2=894887&view=diff ============================================================================== --- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/structure/StructureStrings.properties (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/internal/structure/StructureStrings.properties Thu Dec 31 16:51:08 2009 @@ -18,7 +18,7 @@ write-parameter-failure=Failure writing parameter '%s' of component %s: %s unknown-mixin=Component %s does not contain a mixin of type %s. detach-failure=Listener %s failed during page detach: %s -wrong-phase-result-type=The return value from a render phase event method was not compatible the expected return type of %s. \ +wrong-phase-result-type=The return value from a render phase event method was not compatible with the expected return type. Expected is a component, a block or an instance of %s. \ You should change the method to return the correct type. block-not-found=Template for component %s does not contain a block with identifier '%s'. unbalanced-elements=Component %s has rendered unbalanced elements; \