In order to integrate JForum with my site, I'd like to be able to use some custom tags and other JSP features in the header and footer templates.
According to the freemarker docs, it directly supports using JSP tags like so:
It turns out that this causes an "Expression JspTaglibs is undefined" error. What seems to be the problem is that JForum doesn't use the "TaglibFactory" model which is needed for Freemarker to support taglibs.
Now I don't really know anything about freemarker except what I've learned today, but I'm not sure why this can't be added. Tt looks like JForum just directly uses the Freemarker library with a "SimpleHash" as the model instead of using the Freemarker servlet. But in keeping with this system, can we also add support for the TaglibFactory model?
I'm comfortable making the changes myself, but I could use some suggestions to point me in the right direction.
Thanks! [originally posted on jforum.net by csbook]
Did you manage to workaround this issue. I am just getting started with jforum and I need to include a common header from another jsp file that is using struts taglibs. I have tried adding com.opensymphony.webwork.views.JspSupportServlet to web.xml but I still get following error ;
assignment: html=JspTaglibs["/WEB-INF/struts-html.tld"] [on line 5, column 1 in default/header.htm] in include "header.htm" [on line 1, column 1 in default/forum_list.htm] ---------- Java backtrace for programmers: ---------- freemarker.core.InvalidReferenceException: Expression JspTaglibs is undefined on line 5, column 15 in default/header.htm. at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
Is there any alternate way to integrate jsp struts html tags into freemarker template?
Thanks. [originally posted on jforum.net by shah_m]
Hey, I know this post is a bit late, but maybe it can be helpful to people who are still having this problem.
I had this same error when I was trying to put custom tags into some of the JForum pages and I managed to get it working (I am using JForum 2.1.8 ). The problem is due to the fact that there are some missing context attributes required by Freemarker for it to support custom tags.
This is the code I used to include the tag lib on the page. The url you see here is the taglib uri and is the same one I defined in the TLD file for my tag library. You'll have to check your particular TLD file to know what your URL should be.
And this is the code I used to call one of the tags from my tag library. This tag doesn't have any attributes as you can see.