主要就是搞不懂**.inc是什么东东<%@ include file="header.inc"%>
<jsp:useBean id='clock' scope='page' class='dates.JspCalendar' type="dates.JspCalendar" />
<%@ page language="java" import="java.sql.*" %>
<jsp:useBean id="workM" scope="page" class="test.faq" />
<TABLE border=0 cellPadding=0 cellSpacing=0 width=760 align="center">
<TBODY>
<tr><td align="left" height=25>当前位置:<a href="index.jsp">首页</a> </td>
<%@ include file="date.inc"%>
</tr>
<TR bgColor=#3399ff>
<TD height=1 colspan="6"><IMG height=1 src="images/spacer.gif"
width=16></TD></TR>
<tr><td height=10 colspan="6"><IMG height=1 src="images/spacer.gif"
width=16></td></tr>
</TBODY></TABLE>
<table align="center" border="0" width="760" cellspacing="0" cellpadding="0" height="355">
<tr>
<td width="150" height="355" valign="top">
<%@ include file="table.inc"%>
</td>
<td width="10" height="100%"></td>
<td width="1" height="100%" bgcolor="#3399ff"></td>
<td width="10" height="100%"></td>
<td width="589" height="331" valign="top" background="images/bg1.gif">
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="307">
<tr>
<td width="100%" height="20" bgcolor="">
<a href="mailto:[email protected]">最新动态</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%@ include file="footer.inc"%>
被include的文件header.inc的代码如例程4-2所示<HTML><HEAD><TITLE></TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<LINK href="css/site.css" rel=stylesheet>
<META content="MSHTML 5.00.2014.210" name=GENERATOR></HEAD>
<script language="javascript" src="../js/all.js">
</script>
<BODY bgColor=#ffffff leftMargin=0 topMargin=5 marginheight="5" marginwidth="5">
<table align="center" border="0" width="760" height="18" bgcolor="#3399FF" cellspacing="0">
<tr>
<td width="100%">
<p><a class="x" href="member/list_all_user.jsp">用户列表</a> |
<a class="x" href="book_store/index.jsp">商品列表</a> |
<a class="x" href="../search/index.jsp">查询商品</a> |
<a class="x" href="book_store/all_category.jsp">商品分类</a> |
<a class="x" href="book_store/new_goods.jsp">新货上架</a> |
<a class="x" href="book_store/good_price.jsp">特价市场</a> |
<a class="x" href="book_store/short_goods.jsp">缺货登记</a> |
<a class="x" href="book_store/shopcart.jsp" target="_blank">购物车</a> |
<a class="x" href="book_store/order.jsp" target="_blank">订单</a> |
<a class="x" href="forum/index.jsp" target="_blank">论坛</a> |
<a class="x" href="chat/index.jsp" target="_blank">聊天室</a>
</td>
</tr>
</table> 被include的文件date.inc的代码如例程4-3所示
<td align="right">
<font color="Red"><jsp:getProperty name="clock" property="year"/></font>年
<font color="Red"><jsp:getProperty name="clock" property="month"/></font>月
<font color="Red"><jsp:getProperty name="clock" property="dayOfMonth"/></font>日
星期<font color="Blue"><b><jsp:getProperty name="clock" property="day"/></b></font>
</td>
<td>当前时间为<jsp:getProperty name="clock" property="time"/>
</td>
<td>今天是今年的第<jsp:getProperty name="clock" property="dayOfYear"/>天
</td>
<td>本周是今年的第<jsp:getProperty name="clock" property="weekOfYear"/>周
</td>
<td>本周是本月的第<jsp:getProperty name="clock" property="weekOfMonth"/>周
</td>被include的文件table.inc的代码如例程4-4所示
<table border="1" width="100%" bordercolorlight="#3399FF" bordercolordark="#3399FF" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" valign="top" style="border: 1 solid #3399FF">
<table border="0" width="100%" cellspacing="0">
<tr>
<td width="100%" bgcolor="#3399FF" height="18" align="center">
<font color="#ffffff">成员服务</font></td>
</tr>
<tr>
<td width="100%" height="23" align="center">
<a href="member/login.jsp"><b>登录本站</b></a>
<a href="member/reg.jsp"><b>成员注册</b></a></b></td>
</tr>
<td height="18">
<tr>
<td width="100%" bgcolor="#3399FF" height="18" align="center">
<font color="#ffffff">本站统计</font>
</td>
</tr>
<tr>
<td width="100%">
<table border="0" width="98%" align="center" cellspacing="0">
<tr>
<td align="right" height="20" width="60%">注册用户:</td>
<% int t_member;t_member=0;
String strSQLmem="SELECT id FROM member";
ResultSet RSmem = workM.executeQuery(strSQLmem);
while(RSmem.next())
{
t_member=t_member+1;
}
%>
<td align="left" width="40%"><%=t_member%></td>
</tr>
………….
</table> 被include的文件footer.inc的代码如例程4-5所示
<hr align="center" color="#3399ff" width="760" >
<table align="center" border="0" width="760">
<tr>
<td width="100%" height="18" align="center">
<P class="foot">热爱JSP吧
<a href="mailto:[email protected]">Blueriver</a> <br><br></P>
</td>
</tr>
<tr><td>
</tr>
</table>
</body></html>
<jsp:useBean id='clock' scope='page' class='dates.JspCalendar' type="dates.JspCalendar" />
<%@ page language="java" import="java.sql.*" %>
<jsp:useBean id="workM" scope="page" class="test.faq" />
<TABLE border=0 cellPadding=0 cellSpacing=0 width=760 align="center">
<TBODY>
<tr><td align="left" height=25>当前位置:<a href="index.jsp">首页</a> </td>
<%@ include file="date.inc"%>
</tr>
<TR bgColor=#3399ff>
<TD height=1 colspan="6"><IMG height=1 src="images/spacer.gif"
width=16></TD></TR>
<tr><td height=10 colspan="6"><IMG height=1 src="images/spacer.gif"
width=16></td></tr>
</TBODY></TABLE>
<table align="center" border="0" width="760" cellspacing="0" cellpadding="0" height="355">
<tr>
<td width="150" height="355" valign="top">
<%@ include file="table.inc"%>
</td>
<td width="10" height="100%"></td>
<td width="1" height="100%" bgcolor="#3399ff"></td>
<td width="10" height="100%"></td>
<td width="589" height="331" valign="top" background="images/bg1.gif">
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="307">
<tr>
<td width="100%" height="20" bgcolor="">
<a href="mailto:[email protected]">最新动态</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%@ include file="footer.inc"%>
被include的文件header.inc的代码如例程4-2所示<HTML><HEAD><TITLE></TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<LINK href="css/site.css" rel=stylesheet>
<META content="MSHTML 5.00.2014.210" name=GENERATOR></HEAD>
<script language="javascript" src="../js/all.js">
</script>
<BODY bgColor=#ffffff leftMargin=0 topMargin=5 marginheight="5" marginwidth="5">
<table align="center" border="0" width="760" height="18" bgcolor="#3399FF" cellspacing="0">
<tr>
<td width="100%">
<p><a class="x" href="member/list_all_user.jsp">用户列表</a> |
<a class="x" href="book_store/index.jsp">商品列表</a> |
<a class="x" href="../search/index.jsp">查询商品</a> |
<a class="x" href="book_store/all_category.jsp">商品分类</a> |
<a class="x" href="book_store/new_goods.jsp">新货上架</a> |
<a class="x" href="book_store/good_price.jsp">特价市场</a> |
<a class="x" href="book_store/short_goods.jsp">缺货登记</a> |
<a class="x" href="book_store/shopcart.jsp" target="_blank">购物车</a> |
<a class="x" href="book_store/order.jsp" target="_blank">订单</a> |
<a class="x" href="forum/index.jsp" target="_blank">论坛</a> |
<a class="x" href="chat/index.jsp" target="_blank">聊天室</a>
</td>
</tr>
</table> 被include的文件date.inc的代码如例程4-3所示
<td align="right">
<font color="Red"><jsp:getProperty name="clock" property="year"/></font>年
<font color="Red"><jsp:getProperty name="clock" property="month"/></font>月
<font color="Red"><jsp:getProperty name="clock" property="dayOfMonth"/></font>日
星期<font color="Blue"><b><jsp:getProperty name="clock" property="day"/></b></font>
</td>
<td>当前时间为<jsp:getProperty name="clock" property="time"/>
</td>
<td>今天是今年的第<jsp:getProperty name="clock" property="dayOfYear"/>天
</td>
<td>本周是今年的第<jsp:getProperty name="clock" property="weekOfYear"/>周
</td>
<td>本周是本月的第<jsp:getProperty name="clock" property="weekOfMonth"/>周
</td>被include的文件table.inc的代码如例程4-4所示
<table border="1" width="100%" bordercolorlight="#3399FF" bordercolordark="#3399FF" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" valign="top" style="border: 1 solid #3399FF">
<table border="0" width="100%" cellspacing="0">
<tr>
<td width="100%" bgcolor="#3399FF" height="18" align="center">
<font color="#ffffff">成员服务</font></td>
</tr>
<tr>
<td width="100%" height="23" align="center">
<a href="member/login.jsp"><b>登录本站</b></a>
<a href="member/reg.jsp"><b>成员注册</b></a></b></td>
</tr>
<td height="18">
<tr>
<td width="100%" bgcolor="#3399FF" height="18" align="center">
<font color="#ffffff">本站统计</font>
</td>
</tr>
<tr>
<td width="100%">
<table border="0" width="98%" align="center" cellspacing="0">
<tr>
<td align="right" height="20" width="60%">注册用户:</td>
<% int t_member;t_member=0;
String strSQLmem="SELECT id FROM member";
ResultSet RSmem = workM.executeQuery(strSQLmem);
while(RSmem.next())
{
t_member=t_member+1;
}
%>
<td align="left" width="40%"><%=t_member%></td>
</tr>
………….
</table> 被include的文件footer.inc的代码如例程4-5所示
<hr align="center" color="#3399ff" width="760" >
<table align="center" border="0" width="760">
<tr>
<td width="100%" height="18" align="center">
<P class="foot">热爱JSP吧
<a href="mailto:[email protected]">Blueriver</a> <br><br></P>
</td>
</tr>
<tr><td>
</tr>
</table>
</body></html>
解决方案 »
- 新手jsp页面错误提示请教
- 获得本地IP地址
- 50分!解决tomcat做集群路径问题
- 一个简单而郁闷的问题
- 关于文件上传下载的问题
- 50求教如何在tomcat终止时保存servlet中timer类调度的定时任务?
- 小弟有简单问题提问.望高手指点!!!!!!!!!!!!!!!!
- jsp连接mysql出现了如下问题,请问高手们如何解决呀?
- 只给点文件名就把xml解析成文本文件??
- 请告诉个方法,UP有分,解决奉送200分,有现成代码奉送400分。============================================>
- 请问如何在uedit中加入jsp的语法文件?
- 知到就是知道,不知道就是不知道,我不知道.
.inc文件主要是一些被别的文件include的文件。
通常是因为有很多文件要重复一部分,人们就把这些重复的部分提取出来作为一个单独的文件,当别的文件要用的时候,只需要include这些文件就可以了。
调用也是一样的