When a JSP include directive is used, the included file's code is added into the added JSP page at page translation time, this happens before the JSP page is translated into a servlet. While if any page is included using action tag, the page's output is returned back to the added page. This happens at runtime.
include action and include directive both are used to include the output of multiple jsp and send to the cliet. When we use include directive the output of all the jsp included only one time and creating a temporary jsp and corresponding servlet. Every time when the client send the request only one servlet object is created. When we use include action the server is creating multiple servlet object and execute multiple servlet object when client send request to the server.
It is a static import. It includes the file during its compilation phase. If we want to make some changes on the existing content then it should not be visible at next compilation. It uses ?file? attribute to include the file. Syntax : <% include file=?relatively url path name? %> It is a dynamic import. It includes the file during its request time. If we want to make some changes on the existing content then it should be visible at next request. It uses ?page? attribute to include the file. Syntax : <jsp : include page=?relatively url path name? />