Freemarker : catching a jstl exception within a freemarker template

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

    I have tried to capture an exception(i.e. HTTP 503) raised when
calling an external resources in Freemarker.  For some reason the
exception still bubbles up as a Freemarker error :

FreeMarker template error!

javax.servlet.jsp.JspException: Problem accessing the absolute URL
"http://somedomain.com/header". java.io.IOException: Server returned
HTTP response code: 503 for URL: http://somedomain.com/header
The problematic instruction:

Code :

        <#assign c=JspTaglibs["http://java.sun.com/jsp/jstl/core"]>
        <@c.catch var="someexception">
            <@c.import url="http://somedomain.com/header" />
        </[email protected]>

Mind, you this work perfectly fine, as expected in a jsp file.

If anyone has come across this issue and can provide some direction,
it would be greatly appreciated.

Cheers,
   Theo 
-- 
View this message in context: http://www.nabble.com/Freemarker-%3A-catching-a-jstl-exception-within-a-freemarker-template-tp20491749p20491749.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.