Using data directly from the client is never a good idea. While in this case it's probably fine it's a bad habit to fail into. I would make a enum with the Cookie string and the page class. Use enum.valueOf(cookie) to convert from String to enum and then return the class from the enum. I suspect you can declare the enum in the index class so you can add to it without restarting the web server. This will also allow you to refactor your page classes.
On Friday, March 4, 2016, JumpStart <geoff.callender.jumpst...@gmail.com> wrote: > This example includes returning the logical page name as String: > > > http://jumpstart.doublenegative.com.au/jumpstart7/examples/navigation/returntypes1 > < > http://jumpstart.doublenegative.com.au/jumpstart7/examples/navigation/returntypes1 > > > > Geoff > > > On 4 Mar 2016, at 2:22 pm, mailingl...@j-b-s.de <javascript:;> wrote: > > > > You can just return the string and tapestry locates the page on its own > > > > return cookieVal; > > > > Just make sure the cookieval is a valid page name (class name without > package) > > > > Jens > > > > Von meinem iPhone gesendet > > > >> Am 04.03.2016 um 07:12 schrieb Anbazhagan.G <anbazhaga...@snovabits.net > <javascript:;>>: > >> > >> Hi All, > >> > >> I am working in web application using tapestry framework. I have > following pages a,b,c,d and Index in my application. In Index page, check > some condition and redirect to a particular page. My code, > >> > >> > |if(null!=cookieVal){if(cookieVal.equalsIgnoreCase("a")){returnA.class;}elseif(cookieVal.equalsIgnoreCase("b")){returnB.class;}elseif(cookieVal.equalsIgnoreCase("c")){returnC.class;}elseif(cookieVal.equalsIgnoreCase("d")){returnD.class;}}| > >> > >> Here conditions are increased if pages are increased. How can I > optimize this condition check and redirect to particular page. > >> > >> -- > >> Best Regards, > >> Anbazhagan.G > >> > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > <javascript:;> > > For additional commands, e-mail: users-h...@tapestry.apache.org > <javascript:;> > > > >