jsp+servlet include引入文件指令

1.index.jsp为首页

<%@ page contentType="text/html;charset=UTF-8" import="java.util.*" language="java" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyy-mm-dd");
String t = sdf.format(date);
String copyRightMess = "John 版权所有2010-" + t;
%>
<br/>
<div align="center"><%=copyRightMess%>
</div>

2.Join.html为内嵌页面,用来显示内容

<table align="center" border="1" width="600">
<tr>
<td align="center" height="18" width="100%">
<span>This is top page</span>
</td>
</tr>
</table>

3.copyRight.jsp是显示版权信息的页面

<%@ page contentType="text/html;charset=UTF-8" import="java.util.*" language="java" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyy-mm-dd");
String t = sdf.format(date);
String copyRightMess = "John 版权所有2010-" + t;
%>
<br/>
<div align="center"><%=copyRightMess%></div>

效果图:

jsp+servlet include引入文件指令

上一篇:使用事件捕获实时捕获img是否加载完毕, 实现iframe内容高度自动适应


下一篇:Hadoop单机模式安装-(2)安装Ubuntu虚拟机