So far, we’ve used two different ways to add content from another resource into a JSP. But there’s yet another way, using JSTL.
The include directive
<%@ include file="Header.html" %>
Static: adds the content from the value of the file attribute to the current page at translation time.
The <jsp:include> standard action
<jsp:include page="Header.jsp" />
Dynamic: adds the content from the value of the page attribute to the current page at request time.
The <c:import> JSTL tag
<c:import url="http://www.wickedlysmart.com/skyler/horse.html" />
Dynamic: adds the content from the value of the URL attribute to the current page, at request time. It works a lot like <jsp:include>, but it’s more powerful and flexible.
Unlike the other two includes, the <c:import> url can be from outside the web Container!
Do NOT confuse <c:import> (a type of include) with the “import” attribute of the page directive (a way to put a Java import statement in the generated servlet).
They all have different attribute names! (And watch out for “include” vs. “import”)
Each of the three mechanisms for including content from another resource into your JSP uses a different word for the attribute. The include directive uses file, the <jsp:include> uses page, and the JSTL <c:import> tag uses url. This makes sense, when you think about it... but you do have to memorize all three. The directive was originally intended for static layout templates, like HTML headers. ...