More investigation reveals using doRedirect instead of setTemplate solves the 
problem.

> My test shows setTemplate() doesn't fare better than
> data.setScreenTemplate(). 
> The simplest way you can test by yourself is in TDK, create a class
> Login.java 
> and override method doBuildTemplate to put some debug. In 
> SecureScreen.isAuthorized method, change the code
> data.setScreenTemplate(TurbineResources.getString("template.login"));
> to 
> setTemplate(data, TurbineResources.getString("template.login"));
> 
> The result is the same: Login.java never got called!
> 
> 
> Quoting J�rgen Hoffmann <[EMAIL PROTECTED]>:
> 
> > Hi,
> > 
> > data.setScreenTemplate() sets the Template to be used to render the
> > screen you are in. If you want to redirect a request to another
> > Screen+Template inside a VelocityAction or VelocitySecureScreen you have
> > to use setTemplate() This will invoke the class and the screen.
> > See:
> > http://jakarta.apache.org/turbine/turbine-2.2.0/apidocs/org/apache/turbi
> > ne/modules/actions/VelocityAction.html#setTemplate(org.apache.turbine.ut
> > il.RunData, java.lang.String)
> > http://jakarta.apache.org/turbine/turbine-2.2.0/apidocs/org/apache/turbi
> > ne/modules/screens/TemplateScreen.html#setTemplate(org.apache.turbine.ut
> > il.RunData, java.lang.String)
> > 
> > Kind regards
> >  
> > J�rgen Hoffmann
> > ByteACTION GmbH
> >  
> > cert. Perl Programmer
> > cert. Linux System Administrator
> > cert. Java Programmer
> > 
> > 
> > 
> > -----Urspr�ngliche Nachricht-----
> > Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> > Gesendet: Donnerstag, 26. Juni 2003 21:32
> > An: Turbine Users List
> > Betreff: Re: template and associated class pairing problem
> > 
> > 
> > I know you can use pull model to stuff data into context and let
> > template 
> > decide which one to pick. But it doesn't cure all. 
> > The problem is what and when do you stuff data into context? In some
> > cases the 
> > data is only associated with that screen. The most logical place to
> > populate 
> > the data is in the associated class. Anywhere else (actions etc) will
> > result in 
> > code duplication.
> > 
> > 
> > > > This posed a big problem because major content
> > > > rendering logic could be and
> > > > should be implemented in B.java. 
> > > 
> > > Check out the pull model. In this approach you pull
> > > all the data into each template therefore eliminating
> > > the need to put any content rendering logic in a
> > > screen.  my turbine app uses the pul model and the
> > > only code in any screens is for security purposes.
> > > 
> > > Push vs. Pull: 
> > > http://jakarta.apache.org/turbine/turbine-2.2.1/pullmodel.html
> > > 
> > > Pull HowTo: 
> > > http://jakarta.apache.org/turbine/turbine-2.2.1/howto/pullmodel-howto.
> > > html
> > > 
> > > -Lou
> > > 
> > > __________________________________
> > > Do you Yahoo!?
> > > SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com
> > > 
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > 
> > > 
> > 
> > 
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to