JSP include 使用,jspinclude使用,<%@ page lan
分享于 点击 30799 次 点评:207
JSP include 使用,jspinclude使用,<%@ page lan
<%@ page language="java" contentType="text/html;charset=UTF-8" %><html><head> <title>Java Code Geeks Snippets - Include file in JSP Page</title></head><body> This is the parent JSP which includes a fragment. <%@ include file="fragment.jsp" %></body>
fragment.jsp
<%@ page language="java" contentType="text/html;charset=UTF-8" %><%@ page import="java.util.Date"%><br/>This is a fragment JSP to be included to a parent one. Date is: <%= new Date() %>
访问http://myhost:8080/jcgsnippets/IncludeFile.jsp
输出:
This is the parent JSP which includes a fragment.This is a fragment JSP to be included to a parent one. Date is: Thu Nov 17 21:12:18 EET 2011
用户点评