Re: JSTL c:import 404

Discussion in 'Java' started by Sudsy, Jul 23, 2003.

  1. Sudsy

    Sudsy Guest

    Jan-Friedrich Mutter wrote:
    > Hi,
    >
    > I'm using the Java Standard Tag Library (JSTL) 1.3. I use the c:import
    > tag to include a html snipplet from elsewhere. Sometimes this URL is
    > not available. Thus the import tag throws an exception:
    > javax.servlet.jsp.JspException: Problem accessing the absolute URL
    > "http://local
    > host...".
    > java.io.FileNotFoundException:
    > Response: '404: Not Found' for url: 'http://localhost...'
    > at org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireReader(ImportSupport.java:372)
    > ...
    >
    > My JSP code is:
    > <% String myUrl="http://localhost..."; %>
    > <c_rt:import url='<%=myUrl%>' var="externalHtml" scope="request"/>
    >
    > Due to the exception my whole JSP page is not avaible even only that
    > little html snipplet I imported is not available. But my JSP should be
    > available even when the 'import' fails.
    > Is there a way to ignore the exception and let the space blank?
    >
    > Cheers,
    > Jan.


    <% String myUrl="http://localhost...";
    try {
    %>
    <c_rt:import url='<%=myUrl%>' var="externalHtml" scope="request"/>
    <%
    }
    catch( Exception e ) {
    // print a diagnostic or ignore
    }
    %>
     
    Sudsy, Jul 23, 2003
    #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. Jonathan Folland
    Replies:
    2
    Views:
    1,703
    Jonathan Folland
    Mar 17, 2005
  2. Robert Mark Bram

    Custom JSTL that accepts JSTL expression

    Robert Mark Bram, Dec 15, 2004, in forum: Java
    Replies:
    0
    Views:
    1,018
    Robert Mark Bram
    Dec 15, 2004
  3. alan_sec

    JSTL c:import tag problem

    alan_sec, Mar 20, 2006, in forum: Java
    Replies:
    1
    Views:
    11,019
  4. alan_sec

    JSTL c:import parameters

    alan_sec, Oct 17, 2006, in forum: Java
    Replies:
    6
    Views:
    3,876
    alan_sec
    Oct 18, 2006
  5. DaFoot
    Replies:
    1
    Views:
    1,775
    DaFoot
    Oct 23, 2008
Loading...

Share This Page