Freemarker : catching a jstl exception within a freemarker template

T

theog

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" />
</@c.catch>


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top