Re: Freemarker : catching a jstl exception within a freemarker template
Attila Szegedi <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Can you provide us with a full stack trace? Alternatively, why don't you try FreeMarker's built-in <#attempt> and <#recover> directives? Attila. -- home: http://www.szegedi.org twitter: http://twitter.com/szegedi weblog: http://constc.blogspot.com On 2008.11.14., at 0:22, theodore_au wrote: > > 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 ------------------------------------------------------------------------- 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=/