include « Import « JSP-Servlet Q&A

1. How can you check if a file exists before including/importing it in JSP?

Assuming that requestScope.importMe is expecting a path to a jsp file

    <c:when test="${!empty requestScope.importMe && fileExists(requestScope.importMe) }">
    <c:import url="${requestScope.importMe}" />   
How ...

2. jsp:include vs c:import

3. Difference between import & include

4. jsp:include and c:import combination/nesting

Hi guys, I know I've done this before with Struts.But right now, I'm working on plain Servlets and JSP(Ok, I'm using JSTL). I have a JSP named showitems.jsp which imports two JSP's via two servlets. Those two servlets forward to another page through RequestDispatcher. <%@ taglib uri="" prefix="c" %>