Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Java Development with the Spring Framework
This is the forum to discuss the Wrox book Professional Java Development with the Spring Framework by Rod Johnson, Juergen Hoeller, Alef Arendsen, Thomas Risberg, Colin Sampaleanu; ISBN: 9780764574832
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Java Development with the Spring Framework section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 26th, 2007, 02:34 PM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default ftl templates don't resolve jsp tags

Hi,

I'm using spring 2.0 MVC. I use FreeMarker and its ftls for creating my htmls. also have view resolver and freemarkerTaglibFactory. I use these all cause i do have some JSP tags that are included in the ftls. Whenever i build ModelAndView Object are a return value of the spring controller i get the correct resut, and both ftl and JSP tags are generating my lovely htmls.

The problem took place when I tried to get the html as String. I neede it cause i want the html repersentation to be sent as an email using some service i have. Service works fine and I could get the html generated from ftl. Only one problem is that: the ftl couldn't resolve JSP tags. This doesn't contradict with what i've already said the ftl could resolve JSP tags. cause the first case (JSP is resolved in ftl) was when i return a ModelAndView object to the controller, but the second case (JSP is NOT resolved in ftl ) I was calling ftl this way:
Code:
    public String printFTLtoString(Map dataModel, String templateName) {

        Writer writer = null;
        try{
            writer = new StringWriter();
            freemarker.template.Template template = getFreeMarkerConfigurer().getConfiguration().getTemplate(templateName);
            template.process(dataModel, writer);

        }catch(IOException ex){
            throw new IllegalArgumentException("No template exists with name: "+templateName);
        }catch(TemplateException ex){
            throw new RuntimeException("Couldn't generate string using template:"+templateName, ex);
        }
        return writer.toString();
    }The bean freeMarkerConfigurer is the bean we usually define in IOC container

The bean freeMarkerConfigurer is the bean we usually define in IOC container when we use FreeMarker. could some one tells me why it can't resolve jsp that way although it resolve it when i return a ModelAndView Object?

thanks in advance and I hope i stated my problem clearly!!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
browser version and JSP-custom tags neetukk JSP Basics 1 December 6th, 2006 03:29 AM
XLS with XML containing JSP tags dom4j - weird! azudio XSLT 2 May 24th, 2006 08:32 AM
need to resolve this.,. razmar78 BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 2 November 23rd, 2004 01:41 PM
cannot resolve symbol (struts) tomeksupergosc J2EE 2 November 23rd, 2004 01:19 PM
Error: Cannot resolve symbol "Beginning JSP" amcp2002 Wrox Book Feedback 2 July 22nd, 2003 03:30 PM



All times are GMT -4. The time now is 08:09 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.