Beh, usando JSTL, puoi fare esattamente come in PHP:
codice:
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
...
<c:if test="condizione">
<%@include file="tuo_file.jsp" %>
</c:if>
Per avere anche l'else, puoi usare il costrutto choose:
codice:
<c:choose>
<c:when test="condizione">
<%@include file="tuo_file.jsp" %>
</c:when>
<c:otherwise>
<%@include file="altro_file.jsp" %>
</c:otherwise>
</c:choose>
Ma anche senza JSTL puoi tranquillamente usare le direttive standard JSP:
codice:
<% if ( condizione ) { %>
<%@include file="..." %>
<% } else { %>
<%@include file="..." %>
<% } %>
Ciao.