[
http://jira.magnolia-cms.com/browse/MAGNOLIA-2608?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Danilo Ghirardelli updated MAGNOLIA-2608:
-----------------------------------------
Attachment: taglibs.patch
Just to refute myself, I attached a patch to do what Philipp suggested. The
attached patch wraps freemarker and tricks it to load jars from all the
classpath when they are requested under WEB-INF/lib.
The counterpart getResourceAsStream has been changed as well to do load files
with absolute paths. This is a potentail security problem, but given that the
method is called only by freemarker class and only with the data provided by
the previous method, there should be no risk of loading random files on
filesystem.
This make possible working with freemarker in Magnolia directly under eclipse,
without deploying.
> Tag library support in freemarker does't work with expanded jars
> ----------------------------------------------------------------
>
> Key: MAGNOLIA-2608
> URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-2608
> Project: Magnolia
> Issue Type: Bug
> Security Level: Public
> Components: templating
> Affects Versions: 4.0
> Reporter: Fabrizio Giustina
> Assignee: Fabrizio Giustina
> Priority: Major
> Attachments: taglibs.patch
>
>
> freemarker can't load tag libraries when magnolia (magnolia/trunk) is run
> inside eclipse. The magnolia webapp is run from the eclipse workspace,
> without copying resources to a standard webapp layout (WEB-INF/lib doesn't
> exists and taglib modules are not jarred).
> Unfortunately freemarker looks for taglib in a WEB-INF/lib folder explicitly
> and dies with a NPE if the folder is missing:
> Caused by: java.lang.NullPointerException
> at
> freemarker.ext.jsp.TaglibFactory.getLocationsFromLibJars(TaglibFactory.java:290)
> at
> freemarker.ext.jsp.TaglibFactory.getMoreTaglibLocations(TaglibFactory.java:206)
> at freemarker.ext.jsp.TaglibFactory.get(TaglibFactory.java:163)
> .. or simply complains about the missing taglib if an empty WEB-INF/lib
> directory is created:
> freemarker.template.TemplateModelException: Could not find webapp resource
> /cms-taglib
> at freemarker.ext.jsp.TaglibFactory.loadTaglib(TaglibFactory.java:432)
> at freemarker.ext.jsp.TaglibFactory.access$300(TaglibFactory.java:106)
> at freemarker.ext.jsp.TaglibFactory$Taglib.load(TaglibFactory.java:414)
> (tried by simply adding the demo-project dependency to the empty webapp)
> unfortunately really annoying during development...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------