Freemarker + Apache tiles support

Ashishk80 <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Hi guys,

I was evaluating Jforum. Jforum internally uses freemarker as a view.
I had to integrate jforum with exising tiles based sollution.

I was trying to integrate it. While debugging through freemarker and struts
source code, Basically I see there is no code execution regarding
tiles-def.xml. Because if I remove this file applciation does not
FileNotfoundException, Also if I remove some tag from this file it should
through xml parsing eXception.

 I am getting the following exception 
Can't get definitions factory from context. The problematic instruction: 

---------- ==> user-directive tiles.insert [on line 14, column 1 in
default/recent_thread.htm] ---------- Java backtrace for programmers:
---------- freemarker.template.TemplateModelException: Can't get definitions
factory from context. at
freemarker.ext.jsp.TagTransformModel$TagWriter.onStart(TagTransformModel.java:479)
at freemarker.core.Environment.visit(Environment.java:230) at
freemarker.core.UnifiedCall.accept(UnifiedCall.java:116) at
freemarker.core.Environment.visit(Environment.java:196) at
freemarker.core.MixedContent.accept(MixedContent.java:92) at
freemarker.core.Environment.visit(Environment.java:196) at
freemarker.core.Environment.process(Environment.java:176) at
freemarker.template.Template.process(Template.java:232) at
net.jforum.JForum.processCommand(JForum.java:268) at
net.jforum.JForum.service(JForum.java:233) at 
.....
Caused by: javax.servlet.jsp.JspException: Can't get definitions factory
from context.
	at
org.apache.struts.taglib.tiles.InsertTag.processDefinitionName(InsertTag.java:577)
	at
org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:476)
	at org.apache.struts.taglib.tiles.InsertTag.doStartTag(InsertTag.java:438)
	at
freemarker.ext.jsp.TagTransformModel$TagWriter.onStart(TagTransformModel.java:446)

JForum has a Front controller JForum.java 

I have used the following steps 
I have all the required jar in WEB-INF/lib
I Have tiles-defs.xml.
 I have added in JForum.java

	context.put(FreemarkerServlet.KEY_JSP_TAGLIBS,
							new TaglibFactory(this.getServletContext()));
					DefaultObjectWrapper wrapper = new DefaultObjectWrapper();
					context.put(FreemarkerServlet.KEY_APPLICATION,
							new ServletContextHashModel(this, wrapper));
					context.put(FreemarkerServlet.KEY_REQUEST,
							new HttpRequestHashModel(req, res, wrapper));


Can someone elaborate the exact steps required make working tiles +
freemarker.
Kindly reply through email as well.

Regards,
ashish
[email protected]
-- 
View this message in context: http://www.nabble.com/Freemarker-%2B-Apache-tiles-support-tp19991722p19991722.html
Sent from the freemarker-user mailing list archive at Nabble.com.


-------------------------------------------------------------------------
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=/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.