[ http://jira.magnolia.info/browse/MAGNOLIA-1401?page=comments#action_13647 ] Chris Miner commented on MAGNOLIA-1401: ---------------------------------------
You can use jsp tag libs in your freemarker templates. Here's a couple of examples: <#assign fmt=JspTaglibs["http://java.sun.com/jsp/jstl/fmt"]> <#assign cms=JspTaglibs["/META-INF/cms-taglib.tld"]> Then you can use them like: <@fmt.message key="offer.general.originator.label" /> <@cms.editBar moveLabel="" deleteLabel="" paragraph="OfferGeneralDialogSimple" /> The freemarker TaglibFactory scrounges through your jars looking for tld files. The uri specified in each tld serves logically as the key. Keys can be any of the three forms allowed by the JSP specification: absolute URI, root relative URI and non-root relative URI. see http://freemarker.sourceforge.net/docs/api/freemarker/ext/jsp/TaglibFactory.html So when I try to access <#assign cms=JspTaglibs["cms-taglib"]> "cms-taglib" is treated as a non-root relative URI. It is resolved relative to my page (or template, I don't have the error message anymore) "http://magnolia.info/cms-taglib" is understood as an absolute URI "/META-INF/cms-taglib.tld" is understood as a root relative URI. So as I understand the problem, the cms-taglib.tld declares its uri as a non root relative URI. It seems like it would make more sense if it declared an absolute URI. > Probably cms-taglib.tld and cms-util-taglib.tld should use real uris for > there uris > ----------------------------------------------------------------------------------- > > Key: MAGNOLIA-1401 > URL: http://jira.magnolia.info/browse/MAGNOLIA-1401 > Project: Magnolia > Issue Type: Improvement > Reporter: Chris Miner > Assigned To: Boris Kraft > > Currently the uri in the cms-taglib.tld is defined as: > <uri>cms-taglib</uri> > and in cms-util-taglib.tld it is > <uri>cms-util-taglib</uri> > How would it be to have something like this instead: > http://magnolia.info/cms-taglib > http://magnolia.info/cms-util-taglib > In my particular case it would mean not having to copy the two tlds into my > web root in order to use them from a freemarker template. Besides it seems > like a plain good idea. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.magnolia.info/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ---------------------------------------------------------------- for list details see http://www.magnolia.info/en/developer.html ----------------------------------------------------------------
