Freemarker : catching a jstl exception within a freemarker template

Discussion in 'Java' started by theog, Nov 13, 2008.

  1. theog

    theog Guest

    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
    theog, Nov 13, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert Mark Bram

    Custom JSTL that accepts JSTL expression

    Robert Mark Bram, Dec 15, 2004, in forum: Java
    Replies:
    0
    Views:
    956
    Robert Mark Bram
    Dec 15, 2004
  2. Chris
    Replies:
    1
    Views:
    1,404
    Oliver Wong
    Apr 15, 2006
  3. znôrt
    Replies:
    2
    Views:
    1,084
    znôrt
    Jun 25, 2003
  4. theog
    Replies:
    0
    Views:
    912
    theog
    Jul 7, 2008
  5. DaFoot
    Replies:
    1
    Views:
    1,671
    DaFoot
    Oct 23, 2008
Loading...

Share This Page