From: Lane S. <la...@op...> - 2004-05-26 05:06:38
|
Hi Wm, This concept is a pretty common pattern. The way I solve it: a) In the init() section of a base servlet, parse a template and save the context off as a java variable. b) Insert the context variable before you evaluate the template using a name like "Global". Then, every template has a context variable, $Global.{AnyVariableCreatedInTheGlobalTemplate} You can see a good example of this in the current distribution: o.w.servlets.TemplateServlet.java -Lane Wm Muir wrote: >Hello, > >Just curious about a design concept. > >If you have multiple WMServlet, that all have template that include another >common template (like a banner or header) : > >#include as template "someBanner.wm > >Which has some fields that need to be set. Obviously, you do not want to >include the "context.put(..)" in each and every servlet. Nor would you want >to extend a "SomeBanner" WMServlet. > >What is the best way to have only one instance of code that will populate >the fields in this one common template? > > > > >------------------------------------------------------- >This SF.Net email is sponsored by: Oracle 10g >Get certified on the hottest thing ever to hit the market... Oracle 10g. >Take an Oracle 10g class now, and we'll give you the exam FREE. >http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click >_______________________________________________ >Webmacro-devel mailing list >Web...@li... >https://lists.sourceforge.net/lists/listinfo/webmacro-devel > > > -- Lane Sharman Providing Private and SPAM-Free Email http://www.opendoors.com 858-755-2868 |