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}" />
...
</c:choose>
How can I check if the file exists before trying to include it so that an error is not thrown?
I'd prefer a solution using JSTL tags.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…