Re: A WM brain bender
Alex Twisleton-Wykeham-Fiennes <[email protected]>
| Newsgroups | gmane.comp.java.webmacro.user |
|---|---|
| Message-ID | <[email protected]> |
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:-
static {
System.err.println("StringTemplateLoader booting up");
}
which will tell you whether or not the class is being loaded from the
WebMacro.properties file.
<snip>
> > 2. what was in the WebMacro template that threw the error?
>
> #include "pagebegin.wm"
> <p>
> #foreach $contentItem in $content
> #if ($contentItem.View)
> #include "views/$(contentItem.View).wm"
> #else
> #if ($contentItem.ContentType = "text/html")
> <div>
> <h1>$contentItem.Description</h1>
> #include as template "string:$contentItem.Data"
> </div>
> #end
> #end
> #end
> </p>
> #include "pageend.wm"
>
> The String returned by $contentItem.Data is the text to use as the
> template, i.e. "<p>Hello, $name</p>"
This all looks fine as far as I can see. Try sticking a debug message in the
load method of the StringTemplateLoader to see whether or not it is actually
getting invoked. Can you mail me the source to your StringTemplateLoader off
list and I'll run it besides my EvaluatingTemplateProvider and see if they
behave differently...
Alex
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click