社区
Web 开发
帖子详情
struts里titles和template标签
xj2002423
2008-12-20 12:04:20
我在使用这两个标签时,运行页面都会报Attribute context invalid for tag put according to TLD这个错误,请问是什么原因?
...全文
209
8
打赏
收藏
struts里titles和template标签
我在使用这两个标签时,运行页面都会报Attribute context invalid for tag put according to TLD这个错误,请问是什么原因?
复制链接
扫一扫
分享
转发到动态
举报
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>
struts
and
title
s
Struts
和Tiles是Java Web开发中的两个重要框架,它们在构建动态、模块化的Web应用程序方面发挥着关键作用。
Struts
是Apache软件基金会的Jakarta项目中的一个MVC(Model-View-Controller)框架,而Tiles则是扩展
Struts
...
Struts
2核心
标签
注解
Template
Tag最初是随着
Title
s框架包出现的,但随着
Struts
2的发展,它的使用频率逐渐降低。尽管如此,
Template
Tag仍然在某些特定场景下有着不可替代的作用。 ### 示例代码分析 以下是一段使用
Struts
2核心
标签
的...
title
框架例子
3. 模板(
Template
):定义了页面的基本结构,包括组件的位置和样式。 4. 结合器(Composer):处理请求并决定使用哪个定义来渲染页面。 5. 配置(Configuration):在XML文件中定义所有定义和模板,通常在应用启动...
struts
1
title
s框架的使用
在页面直接使用
title
s
标签
先引入
标签
: 将模板页面要代替的内容用
标签
占位: 在另外一页面将模板页与内容页整合: 1. 使用tiles框架 先插入框架的插件 ...
使用
Struts
2的
Title
s做页面布局
我们可以使用
struts
2的
title
s来做页面基本布局,使得页面看起来统一一致:包括<tiles:insertAttribute name="body"/>和 <tiles:getAsString name="
title
"><...
Web 开发
81,121
社区成员
341,743
社区内容
发帖
与我相关
我的任务
Web 开发
Java Web 开发
复制链接
扫一扫
分享
社区描述
Java Web 开发
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章