[MAGNOLIA-2608] Tag library support in freemarker does't work with expanded jars Created: 31/Jan/09 Updated: 12/Sep/11 Resolved: 09/Sep/11 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | templating |
| Affects Version/s: | 4.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Fabrizio Giustina | Assignee: | Fabrizio Giustina |
| Resolution: | Duplicate | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Template: |
|
||||||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||||||||||
| Date of First Response: | |||||||||||||||||
| Description |
|
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). Caused by: java.lang.NullPointerException .. 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 (tried by simply adding the demo-project dependency to the empty webapp) unfortunately really annoying during development... |
| Comments |
| Comment by Philipp Bracher [ 03/Feb/09 ] |
|
The only way to make freemarker happy if the tld is not in the jar (this is the case if you develop in eclipse for instance) is to copy the tld files to WEB-INF and register the tlds in the web.xml. <jsp-config>
<taglib>
<taglib-uri>cms-taglib</taglib-uri>
<taglib-location>cms-taglib.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>cms-util-taglib</taglib-uri>
<taglib-location>cms-util-taglib.tld</taglib-location>
</taglib>
</jsp-config>
|
| Comment by Michael Vorburger [ 04/Jan/11 ] |
|
Hola Magnolians in Basel. FYI I've hit the same issue, in a completely different (non-Magnolia) context of FreeMarker, and just wanted to make you aware of https://sourceforge.net/tracker/?func=detail&aid=3151460&group_id=794&atid=100794. You may be interested in both watching my FreeMarker feature request, as well as my description in there how I worked around this (especially if you are using Jetty, are you?). Greetings, from Lausanne! |
| Comment by Philipp Bärfuss [ 11/Jan/11 ] |
|
That is really an obstacle for Magnolia newcomers developing in eclipse. Should had opened such a ticket long before. Thanks for taking action on this. |
| Comment by Danilo Ghirardelli [ 07/Sep/11 ] |
|
There is also Manuel's patch in the linked issue that could work with the current implementation of freemarker, without waiting for servlet 3.0 |
| Comment by Fabrizio Giustina [ 09/Sep/11 ] |
|
closing as duplicate, all the related comments have been moved to |