<tiles-definitions>
<definition name="template"
path="/jsp/common/MainTemplate.jsp">
<put name="title" value="模板测试页面" type="string" />
<put name="header" value="/jsp/common/header.jsp" type="page" />
<put name="body" value="/jsp/common/body.jsp" type="page" />
<put name="footer" value="/jsp/common/footer.jsp" type="page" />
</definition></tiles-definitions>
MainTemplate.jsp页,如下
<html>
<head>
<title><tiles:getAsString name="title"/></title>
</head>
<body topmargin="0" bottommargin="0">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="Gray">
<tr>
<td height="150"><tiles:insert attribute="header"/></td>
</tr>
<tr>
<td height="100%"><tiles:insert attribute="body"/></td>
</tr>
<tr>
<td height="100"><tiles:insert attribute="footer"/></td>
</tr>
</table>
</body>footer.jsp如下 <table width="100%" height="120" border="0" background="../../image/1bak1.jpg">
<tr>
<td width="100%"><div align="center" class="style1">footer</div></td>
</tr>
</table>
我访问单页footer.jsp时background图片能显示
访问tiles template 时,图片能显示就不能显示原因,如何解决哦。
<definition name="template"
path="/jsp/common/MainTemplate.jsp">
<put name="title" value="模板测试页面" type="string" />
<put name="header" value="/jsp/common/header.jsp" type="page" />
<put name="body" value="/jsp/common/body.jsp" type="page" />
<put name="footer" value="/jsp/common/footer.jsp" type="page" />
</definition></tiles-definitions>
MainTemplate.jsp页,如下
<html>
<head>
<title><tiles:getAsString name="title"/></title>
</head>
<body topmargin="0" bottommargin="0">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="Gray">
<tr>
<td height="150"><tiles:insert attribute="header"/></td>
</tr>
<tr>
<td height="100%"><tiles:insert attribute="body"/></td>
</tr>
<tr>
<td height="100"><tiles:insert attribute="footer"/></td>
</tr>
</table>
</body>footer.jsp如下 <table width="100%" height="120" border="0" background="../../image/1bak1.jpg">
<tr>
<td width="100%"><div align="center" class="style1">footer</div></td>
</tr>
</table>
我访问单页footer.jsp时background图片能显示
访问tiles template 时,图片能显示就不能显示原因,如何解决哦。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货