In jsp we can use both jsp include tag and page directive include tag to include jsp classes in another jsp file.
<jsp:include page="sample.jsp" flush="false" />
<%@include file="./inc/jsp3.jsp" %>
To my knowledge the main difference is <jsp:include>
the file is being included during request processing and <%@include file="">
included at jsp to servlet translation phase.
Althought while working in a real world projects I mostly see jsp include tags are in dynamic web pages loading inside of another jsp page and directive include tag in basic header footer attachment to the jsp pages.
What are the different practical scenarios that we should use these tags and why? Please give me a small explanation (with example if possible).
Thank you.