Re: Dashes in JSP Taglib names
Daniel Dekany <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Friday, May 13, 2011, 5:42:49 PM, Barrie Selack wrote: > We use dashes in Taglibs. > > > <company-ui:panel-container></company-ui:panel-container> > > A college came across this issue. Is this a bug, or works as designed? > > A note from him... > > "Free marker doesn't accept dashes in tag names. The result is > complete an utter failure to parse the template. (I think the lexer is croaking altogether.)" > > Is this something that Freemarker can be updated to do? Or does it > already do this, and we are missing something? FreeMarker wasn't designed with JSP in mind... the whole JSP support was an extension added later that technically could have been 3rd party as well. I mean, it doesn't affect the core. And so come the miss-match: the name-like part in a FreeMarker @ tag is a free form expression, not just a name like in JSP or in XML. Hence dash means subtraction. The workaround is that instead of this: <@ui.panel-container /> you write this: <@ui["panel-container"] /> Ugly, but works. As of the future, I think it could be addressed. Since the result of a subtraction is always a pure number, and you can't call a number, the parser could be smarter and guess the intent. Dirty, but sounds useful... > Thanks, > Barrie -- Best regards, Daniel Dekany ------------------------------------------------------------------------------ Achieve unprecedented app performance and reliability What every C/C++ and Fortran developer should know. Learn how Intel has extended the reach of its next-generation tools to help boost performance applications - inlcuding clusters. http://p.sf.net/sfu/intel-dev2devmay