On 3/14/06, Nathan Bubna <[EMAIL PROTECTED]> wrote: > > 1. I don't see how I can use tags with body content. Freemarker > > syntactally supports tag invocations similar to a foreach loop, but > > without changing velocity's syntax, I can't see any way to provide > > similar capabilities. Do you have any ideas on this? > > i think i'd have to see some of the code before i can suggest many > ideas. Velocity does support custom directives that take body > content. i think WebWork took this route when creating their tag > support for Velocity.
Can you point me to how custom directives could take body content (a doc page, some sample code, whatever)? > > 2. Do you have any ideas on syntax for how to access a tag invoker? > > very tough call. it feels like there are only three options: The idea of passing body content to a tag opens my mind a lot. I had been thinking of more limited ideas. In broad strokes, this is what my code is doing right now: - creates the tag instance - sets user attributes using beanutils (a new dependency I realize) - creates a fake pageContext object based on a provided request object - sets tag attributes that the JSP page usually would (parent, pagecontext) - inits the tag - runs the tag without support for body content - destroys the tag - returns what the tag spat out to its writer as a String What is needed is: - support for bodycontent - support for looping (which wasn't necessary before body content was an option) - reading a TLD to understand the tag mappings - figure out how you reference that you're using a TLD (what is this library's equivalent of a taglib page declaration in JSP) - instantiate a tag based on its short name in the TLD - validate what attributes are passed according to the TLD Some other thoughts: - EL won't be supported. - nesting tags would be good... again I hadn't thought about this at all because of no understanding that body content would be an option. - syntax is completely up in the air still. I have to think about the options you gave. - .tag file support that Will mentioned... My 2 cents... I'm not that concerned about this since Velocity can do the equivalent with macros. I figure the best benefit of this (entire) feature is giving Velocity developer access to some feature in a JSP taglib (like ajaxtags or displaytag or jodatag), and I don't see anyone distributing these as .tag files yet. What I'll do is mockup the code I have and create a little war (or something) that shows what at this point. -- Serge Knystautas Lokitech >> software . strategy . design >> http://www.lokitech.com p. 301.656.5501 e. [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
