1 struts2标签的定义文件 struts-tags.tld
2014-10-09 10:25
162 查看
在工程中使用struts2标签
一、
struts2标签定义文件在struts2-core-2.0.11.1\META-INF 下面,文件名为struts-tags.tld
二、
如果工程使用了servlet2.3规范,要做两件事,就能在工程中使用struts2标签了
1: 在web.xml中增加标签库的定义
<taglib>
<taglib-uri>/struts-tags</taglib-uri>
<taglib-location>/WEB-INF/lib/struts2-core-2.0.11.1.jar</taglib-location>
</taglib>
/struts-tags 是struts2标签库默认的URI,建议使用这个名称
2 在JSP中使用taglib编译指令导入标签库 <%@ taglib prefix="s" uri="/struts-tags" %>
三、
如果使用servlet2.4规范,不须要在web.xml中增加标签库定义,只要做一件事,就行
1 在JSP中使用taglib编译指令导入标签库 <%@ taglib prefix="s" uri="/struts-tags" %>
四、
struts2标签自动提示功能(解决struts2标签出现红叉)
1 把struts2包中的struts-tags.tld提取出来,放入本地硬盘上,我放入了E:\workspace\pic\bin\WEB-INF\tld\struts-tags.tld
2 eclipse--window--preferences 输入TLD进行搜索 ,选择Amateras--TLD开始添加本地TLD文件,
点Add ,URI 项输入:/struts-tags ,Local Path项输入:E:\workspace\pic\bin\WEB-INF\tld\struts-tags.tld
点OK ,重启eclipse 写struts2标签时,就有提示了,红叉也没了
如图
![](http://dl.iteye.com/upload/attachment/0068/9830/06a91643-6daa-3d0c-8bea-a52b38311826.jpg)
大小: 49.9 KB
查看图片附件
一、
struts2标签定义文件在struts2-core-2.0.11.1\META-INF 下面,文件名为struts-tags.tld
二、
如果工程使用了servlet2.3规范,要做两件事,就能在工程中使用struts2标签了
1: 在web.xml中增加标签库的定义
<taglib>
<taglib-uri>/struts-tags</taglib-uri>
<taglib-location>/WEB-INF/lib/struts2-core-2.0.11.1.jar</taglib-location>
</taglib>
/struts-tags 是struts2标签库默认的URI,建议使用这个名称
2 在JSP中使用taglib编译指令导入标签库 <%@ taglib prefix="s" uri="/struts-tags" %>
三、
如果使用servlet2.4规范,不须要在web.xml中增加标签库定义,只要做一件事,就行
1 在JSP中使用taglib编译指令导入标签库 <%@ taglib prefix="s" uri="/struts-tags" %>
四、
struts2标签自动提示功能(解决struts2标签出现红叉)
1 把struts2包中的struts-tags.tld提取出来,放入本地硬盘上,我放入了E:\workspace\pic\bin\WEB-INF\tld\struts-tags.tld
2 eclipse--window--preferences 输入TLD进行搜索 ,选择Amateras--TLD开始添加本地TLD文件,
点Add ,URI 项输入:/struts-tags ,Local Path项输入:E:\workspace\pic\bin\WEB-INF\tld\struts-tags.tld
点OK ,重启eclipse 写struts2标签时,就有提示了,红叉也没了
如图
![](http://dl.iteye.com/upload/attachment/0068/9830/06a91643-6daa-3d0c-8bea-a52b38311826.jpg)
大小: 49.9 KB
查看图片附件
相关文章推荐
- struts2标签定义文件 struts-tags-tld
- struts2 标签文件struts-tags.tld使用设置
- struts2标签引用<%@ taglib prefix ="s" uri="/struts-tags"%>报错
- Struts2标签问题-using Struts tags without the associat
- struts——/struts-tags.tld 标签库
- struts2的struts-tags标签
- struts2 02 struts.xml文件中的标签
- struts2中的配置文件的<constant>标签(struts.xml自动加载)
- Struts2标签错误:using Struts tags without the associat解决
- [struts2]常用的Struts 2.0的标签库
- struts2的struts.properties配置文件详解
- Struts配置文件详解,web.xml以及struts-cofig.xml,以及struts-cofig.xml中各个标签的作用。
- struts2的struts.properties配置文件详解
- 描述自定义标签的TLD文件
- Struts2中有关struts-default.xml,struts.xml,struts.properties文件详解
- 【Struts2.0】struts2的struts.properties配置文件详解
- struts配置文件中的form定义中使用string[]的一点疑问
- [搬家文]struts2主要的配置文件提要[Struts.xml]
- struts2的struts.properties文件详解
- 关于在eclipse新建tld标签库描述文件的问题