I am including some JSP pages in one JSP page, whose names are in the keys of Map
which I am iterating. In case if any of the JSP page is not found in my folder, then it throws exception, which I further handle in <c:catch>
.
<c:set var="pagePath" value="/WEB-INF/pages/adminModule/"/>
<c:set var="jspName" value="${childItems.key}"/>
<c:set var="jspVar" value="${pagePath}organizationFilter${jspName}.jsp" />
<c:set var="jspVar" value="${fn:replace(jspVar,' ', '')}"/>
<c:catch var="e">
<jsp:include page="${jspVar}"/>
</c:catch>
<c:if test="${!empty e}">
<!-- ignore file doesnot exists-->
</c:if>
But the file not found exception is getting logged in server log. How can I stop that exception to come in server log?