Re: Expression JspTagLibs is undefined
Daniel Dekany <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Wednesday, September 10, 2008, 4:34:48 PM, Anderson Geison Borges wrote: > Hello people, I know that there are some posts around this issue, > but I couldn´t found anything relationed to my problem, Take a look, > In the Freemarker Utils file I created the code is as follow: > Configuration cfg = new Configuration(); > cfg.setDirectoryForTemplateLoading(new > File(PortalUtil.getServerPath() + TEMPLATES_FOLDER)); > cfg.setObjectWrapper(new DefaultObjectWrapper()); Template t = > cfg.getTemplate(templateName); StringWriter writer = new > StringWriter(); t.process(map, writer); in my ftl file I have the > line: <#assign form=JspTagLibs["/WEB-INF/form.tld"]> but when the > code is running, I get this error: 23:31:15,502 ERROR runtime:96 - > Expression JspTagLibs is undefined on line 1, column 15 in > formListItemColumns.ftl. The problematic instruction: ---------- ==> > assignment: form=JspTagLibs["/WEB-INF/form.tld"] [on line 1, column > 1 in formListItemColumns.ftl] ---------- Java backtrace for > programmers: ---------- freemarker.core.InvalidReferenceException: > Expression JspTagLibs is undefined on line 1, column 15 in > formListItemColumns.ftl. at > freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124) > at > freemarker.core.DynamicKeyName._getAsTemplateModel(DynamicKeyName.java:75) > I searched the forum and the mailling list but no one had a true > especification about what is wrong about the error... I should > register the freemarker in any xml in the system? that taglib works well in jsp environment... > I´m using FreeMarker 2.3.14 Thanks in advance for any kind of help try! The JspTagLibs variable is put into the data-model by the FreemarkerServlet. So if you aren't using FreeMarker through the FreemarkerServlet, then that causes the problem. -- Best regards, Daniel Dekany ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/