From: Marc P. <ma...@an...> - 2005-03-11 16:22:12
|
Alex Twisleton-Wykeham-Fiennes wrote: > On Friday 11 March 2005 15:57, Marc Palmer wrote: > >>>Two questions:- >>> >>>1. what package did you put your StringTemplateLoader class into? >> >>package org.webmacro.resource; > > > OK. maybe put the following into your StringTemplateLoader:- Yep it is loading, and setConfig gets called. However load() is never called. More info - my content in the previous example was empty. I changed the template to do this: #include as template "string:testing" And the error is: 16:15:38 resource WARNING BrokerTemplateProvider: Template not found: string:testing org.webmacro.ignition.cms.ViewEngineException: org.webmacro.PropertyException: #include string:testing: Not found by template provider So for some reason the string: handler is being overlooked and its just using the Broker which of course fails. DelegatingTemplateProvider.load is not being called either. Odd. Src: public class StringTemplateLoader extends AbstractTemplateLoader { public final static String PROTOCOL = "string:"; public void setConfig(String config) { } public Template load(String query, CacheElement ce) throws ResourceException { if (!query.startsWith(PROTOCOL)) { return null; } return new StringTemplate(broker, query.substring(PROTOCOL.length())); } } Cheers -- Marc Palmer - - - wj...@wa... Wangjammers, J2ME Developers ~ http://www.wangjammers.org/games/ Blog ~ http://www.jroller.com/page/Wangjammer5 |