JSP -- Reusing content in JSP page.
There are three ways to reuse the content in jsp pages:
1. include directive <%@ include file="filename" %>
This directive just inserts the static content or dynamic content into the including jsp file before the jsp file is compiled into servlet.
2. preludes and codas
3. jsp:include element, not a directive of jsp
The results of including static and dynamic resources are quite different. If the resource is static, its content is inserted into the calling JSP file. If the resource is dynamic, the request is sent to the included resource, the included page is executed, and then the result is included in the response from the calling JSP page. Like:
<jsp:include page="response.jsp"/>
Transfer control to another web component:
<jsp:forward page="filename.jsp"/>
<jsp:param name="xx" value="vvv"/>
本文介绍了JSP页面中内容复用的三种方法:使用include指令、预置和尾置以及<jsp:include>元素。详细解释了静态资源与动态资源包含的区别及<jsp:forward>的用法。
507

被折叠的 条评论
为什么被折叠?



