FileTemplateLoader doesnt close reader ?

Albert Kam <[email protected]> Tue, 12 Mar 2013 14:20:18 +0700
Newsgroups gmane.comp.web.freemarker.user
Message-ID <CAMT20g_YG2+EzrLcncYFj7gxun-qp9o0rFDPMDr9zw-Lkzafjw@mail.gmail.com>
I took a peek at FileTemplateLoader.java and notices that
the closeTemplateSource() is empty method.
Is it okay not to close the Reader returned from getReader() ?

I am asking this because i am trying to mimic the best practice when
creating a custom TemplateLoader.

In my case, when following the instruction to auto-escape in here :
http://watchitlater.com/blog/2011/10/default-html-escape-using-freemarker/ :

- I found out that closing the reader returns an empty page after the
process. Commenting the IOUtils.closeQuietly() solves the empty page
problem.
- So i thought maybe i should close the reader (maybe through a ThreadLocal
storing the reader) in the closeTemplateSource()
- So i peeked the FileTemplateLoader for an example, and thus this post to
clarify.

Please share your thoughts.

Thank you,
Albert Kam

-- 
Do not pursue the past. Do not lose yourself in the future.
The past no longer is. The future has not yet come.
Looking deeply at life as it is in the very here and now,
the practitioner dwells in stability and freedom.
(Thich Nhat Hanh)

------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev

_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user