From tapestry-user Thu Nov 29 22:49:47 2007 From: Kaspar Fischer Date: Thu, 29 Nov 2007 22:49:47 +0000 To: tapestry-user Subject: Re: Dynamic pages (or: arguments to pages) [T4] Message-Id: <68BCDA02-7901-4BC1-9285-A571B3145DDF () inf ! ethz ! ch> X-MARC-Message: https://marc.info/?l=tapestry-user&m=119637662813311 On 29.11.2007, at 11:02, Ulrich Stärk wrote: > These are just guesses, I haven't tried them nor verified them. > I could imagine that the parameter isn't available via the > WebRequest because the page didn't get called by a GET request > directly but with the help of the service encoder, so your > parameter isn't there anymore when the page get's rendered. Try to > get hold of the IRequestCycle by calling getRequestCycle() and call > getParameter on it. I wouldn't be surprised if it's in there. Hi Uli, That was it! It turns out that the @InjectObject("infrastructure:request") public abstract WebRequest getRequest(); is not needed anymore with this solution. Thanks a lot for the help, Kaspar P.S. For the sake of completeness, here is the complete solution -- in case somebody else needs it. public abstract class MyPage extends BasePage implements PageBeginRenderListener { public void pageBeginRender(PageEvent event) { super.pageBeginRender(event); // find out the node we're suppost to show IRequestCycle cycle = getRequestCycle(); String myParam = cycle.getParameter("myParam"); } // ... } public class KCNodeServiceEncoder implements ServiceEncoder { // ... public void decode(ServiceEncoding encoding) { // ... (get parameter value from URL) encoding.setParameterValue("myParam", value); } } --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org For additional commands, e-mail: users-help@tapestry.apache.org