Request attributes are global while template variables (which are in fact ExecutionContainer attributes) are local to that container execution. A request attribute set in in slot will be available to all slots that execute later and to all templates that are rendered later while a template variable set in a slot will only be available in that template. In general, use template variables since that protects you from naming collisions.
It is possible to use request attributes to handle javascript/css inclusions, however, there are a few things to look out in combination with caching. The general recommendation is to use response attributes from 1.1 on. felix On Jan 5, 2010, at 11:14 AM, Michal wrote: > Hi, > > To populate templates, when should template variables be used, and > when should request attributes be used? Both can be set in > actions/views, both accessed in templates, and both cached. I see that > a request attribute can be namespaced, but is this the only > difference? > > Looking at http://www.mivesto.de/agavi/agavi-faq.html#caching_1 , it > seems that scripts and css are set as request attributes, but the > titles and meta content set as template variables. Why is this? > > Thanks, > > Michal. > > _______________________________________________ > users mailing list > [email protected] > http://lists.agavi.org/mailman/listinfo/users > -- Felix Gilcher Bitextender GmbH Paul-Heyse-Str. 6 D-80336 München T: +49 89 57 08 15 16 F: +49 89 57 08 15 17 M: +49 172 840 88 28 [email protected] http://www.bitextender.com/ Amtsgericht München, HRB 174280 Geschäftsführer: David Zülke, Florian Clever _______________________________________________ users mailing list [email protected] http://lists.agavi.org/mailman/listinfo/users
