日期:2014-05-16  浏览次数:20535 次

JSP—include指令(静态包含和动态包含)

JSP九大隐式对象|request|response|config|application|exception|Session|page|out|pageContext

?

include指令(静态包含(编译时包含),它包含的所有jsp会编译成一个servlet)

<%@include file="/public/head.jsp" %>
    
    aaaaaaaaaaaaaaaa<br/>
    
<%@include file="/public/foot.jsp" %>

?动态包含(这种情况是运行时包含(被包含的jsp会分别编译成单独的servlet))

<% 
    	request.getRequestDispatcher("/public/head.jsp").include(request,response);
%>
<% 
   	response.getWriter().write("aaaaaaaaaaaaa<br/>");
%>
<% 
    	request.getRequestDispatcher("/public/foot.jsp").include(request,response);
%>