Apply the include directive and the include action ID to include a file in a JSP page, respectively.
hello.jsp
<%@ page language= "Java"Import= "java.util.*" pageencoding= "Utf-8"%><%String Path=Request.getcontextpath (); String BasePath= Request.getscheme () + "://" +request.getservername () + ":" +request.getserverport () +path+ "/";%><! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >This is the included file 2, which applies the include action. <br> MYJSP.JSP:Import= "java.util.*" pageencoding= "Utf-8"%> <body> <br>
INDEX.JSP:<%@ page language= "Java"Import= "java.util.*" pageencoding= "Utf-8"%><%String Path=Request.getcontextpath (); String BasePath= Request.getscheme () + "://" +request.getservername () + ":" +request.getserverport () +path+ "/";%><! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >using the Include directive<br> <%@ include file= "myjsp.jsp"%>using the Include action Directive<br> <jsp:include page= "hello.jsp" flush= "True|false"/> </body><ml>
The
Applies the include directive and the include action identity to include a file in a JSP page, respectively.