> > I have tried to return > false in onActiavate() method but no luck.
Not sure what you'd expect to happen here if you return false. Redirecting to another page is a good answer, even if it's just back to the front page. Don't forget that your empty onActivate handler is always called. I often save the arguments passed in to the onActivate(args) method and then process them in the onActivate(). Then if the id you expected is not set you can redirect the user to another page. Object onActivate() { if ( theIdISavedInTheOtherOnActivate == null ) return List.class // do stuff with the id } as far as saving your context, it depends on what you are trying to do, can you give a more complete example? You might just need to pass context to the form? <t:form t:id="form" t:context:"id"> ... </t:form> Josh On Fri, Dec 14, 2012 at 3:43 PM, bhorvat <horvat.z.bo...@gmail.com> wrote: > So what would be the best way to prevent a page to be accessed without some > context? > > I have a onActivate(Long id) method but I want to prevent users from simply > accessing the page by typing the name of the page. I have tried to return > false in onActiavate() method but no luck. > > Is the only choice to return some other page if they try to access this > way? > > Also I want to know what is the best way to save cotext. Using onPasivate > maybe? I have a form on that page and once it gets triggered it loses all > the data (@Persist annotation save my selected choice but I still want to > see stuff in the url) So what should I use for that. > > Thanks > > > > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/Best-way-to-prevent-page-to-be-accessed-without-context-tp5718737.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >