struts里titles和template标签

xj2002423 2008-12-20 12:04:20
我在使用这两个标签时,运行页面都会报Attribute context invalid for tag put according to TLD这个错误,请问是什么原因?
...全文
209 8 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
book_flybird915 2008-12-21
  • 打赏
  • 举报
回复
楼主确定下面标签里的uri是正确的吗?
<%@ taglib uri="struts-template" prefix="template" %>
xj2002423 2008-12-21
  • 打赏
  • 举报
回复
这工程里只有这个struts-template.tld。这项目是以前别人写的,现在部分页面要改一下,里面页面框架都用template标签来实现的。放在tomact里运行,大多数页面都显示不了,都报同一个错误。
book_flybird915 2008-12-21
  • 打赏
  • 举报
回复
楼主的struts版本号是多少?
如果是1.1以上的应该用struts-tiles.tld
看看你的工程里是不是既有struts-template.tld又有struts-tiles.tld
xj2002423 2008-12-21
  • 打赏
  • 举报
回复
我在web.xml里配置,这样写应该没有错吧?
<taglib>
<taglib-uri>struts-template</taglib-uri>
<taglib-location>/WEB-INF/struts-template.tld</taglib-location>
</taglib>
book_flybird915 2008-12-20
  • 打赏
  • 举报
回复
楼主把代码贴上来给大家看看啊!
xj2002423 2008-12-20
  • 打赏
  • 举报
回复
不行。template没有value这个属性。错误还是一样:Attribute value invalid for tag put according to TLD
meiwenhui 2008-12-20
  • 打赏
  • 举报
回复
<template:put name="footbar" content="/pagestruct/footbar.jsp" />
contenthu换成value (我是新手)
xj2002423 2008-12-20
  • 打赏
  • 举报
回复
index.jsp

<%@ page language="java" contentType="text/html; charset=GBK"%>
<%@ taglib uri="struts-template" prefix="template" %>


<template:insert template="/template/Templateypjustice.jsp">
<template:put name="title" content="XXXXX" direct="true"/>
<template:put name="header1" content="/pagestruct/header1.jsp" />
<template:put name="header2" content="/pagestruct/header2.jsp" />
<template:put name="header3" content="/intro/pagestruct/header3.jsp" />
<template:put name="content" content="/intro/index_content.jsp" />
<template:put name="leftbar" content="/intro/pagestruct/leftbar.jsp" />
<template:put name="footbar" content="/pagestruct/footbar.jsp" />
</template:insert>

Templateypjustice.jsp

<%@ page contentType="text/html; charset=GBK"%>
<%@ page errorPage="/template/error_manage.jsp"%>
<%@ taglib uri='struts-template' prefix='template' %>
<html>
<head>
<title><template:get name='title' /></title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<template:get name='js' />
<link rel="stylesheet" href="/ypjustice/style.css">
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><table width="760" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="8"><img src="/ypjustice/images/index_1.gif" width="760" height="8"></td>
</tr>
<tr>
<td height="167" valign="top"><table width="760" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="202" valign="top"><template:get name='header1' /></td>
<td width="558" valign="top"><template:get name='header2' /></td>
</tr>
</table></td>
</tr>
<tr>
<td height="24" background="/ypjustice/images/index_14.gif"><template:get name='header3' /></td>
</tr>
<tr>
<td valign="top">
<table width="760" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="202" valign="top" class="td1"><template:get name='leftbar' /></td>
<td valign="top"><template:get name='content' /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="27" bgcolor="#0168B5"><template:get name='footbar' /></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>

81,121

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧