This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes Conversion of free marker templates (ftl) to jsp's Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Conversion of free marker templates (ftl) to jsp Watch "Conversion of free marker templates (ftl) to jsp New topic
Author

Conversion of free marker templates (ftl) to jsp's

Nikhil Das Nomula
Greenhorn

Joined: Jun 10, 2011
Posts: 26
I need to convert some ftl files into JSP's and I am not sure how do I go about with it. I am not that familiar with freemarker too. Can someone suggest me how should I approach this issue.
Nikhil Das Nomula
Greenhorn

Joined: Jun 10, 2011
Posts: 26
I was going through my profile and how stupid was i ask this kind of question. However, if anyone wondered why I asked this question at that point of time was that we were using struts as the front end for our web application. And the view components were written in ftl's and JSP's. Struts support for ftl's is well known but it makes life complicated to debug. Hence we wanted to convert those ftl's into jsp's. So to do this in a struts application, you need to have a thorough understanding of OGNL because that is how the data is moved to/from the view in a struts application. All I needed to do is just change the syntax from ftl's to jsp's.
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

It's not that easy.

Freemarker/velocity type template engines usually require an interceptor or filter.

If you must do this, save the generated HTML from the browser and work backwards to JSP.
(Or better yet, JSF)

WP
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61299
    
  66

JSF is a completely different beast; avoid it.

It'd be much simpler to convert to JSPs. The servlet controller can perpare any data needed by the JSPs.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Nikhil Das Nomula
Greenhorn

Joined: Jun 10, 2011
Posts: 26
Yea JSP's are much simpler and straightforward
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Conversion of free marker templates (ftl) to jsp's