include « Import « JSP-Servlet Q&A





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

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

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

2. jsp:include vs c:import    coderanch.com

3. Difference between import & include    coderanch.com

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

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="http://java.sun.com/jsp/jstl/core" prefix="c" %>