JSP Tags

Including Java Code

The tags for including java code in a JSP are <% %>.

<%
  int x = 0;
 
  x++;
%>

Including a File

There are two tags for including files.

<%@ include file="/path/from/web-app-root/to/file" %>
This will include the file into the current JSP before the servlet is generated for the JSP.
<jsp:include page="/path/from/web-app-root/to/file" />
This will include the output of the page at runtime. If the page is a JSP, then the output genereated from the JSP will be included in the output of current JSP.