日期:2014-05-16  浏览次数:20366 次

请教JSP自定义标签中的SimpleTagSupport和TagSupport与BodyTagSupport
今天在网上搜索自定义标签,搜到TagSupport与BodyTagSupport
和SimpleTagSupport这两种类型

我要为项目中 特定代码的判断 开发个通用的标签,但是不知道应该使用哪种呢

1。他们之间的区别是什么? 在网上没有搜到同时讲两个的。

2。看到项目中原有的标签是用的是TagSupport,又看到网上说SimpleTagSupport是2.0新增的类,但是我不知道是用哪种比较好呢?

以下是我搜到的网址
http://hi.baidu.com/java__sc/blog/item/56396d3eb33e8b3d70cf6c02.html
http://blog.csdn.net/newould/archive/2006/09/12/1214509.aspx?Pending=true

1 楼 daoger 2006-11-08  
开发自定义标签,可以实现接口(SimpleTag或Tag),也可以使用实现类(TagSupport或SimpleTagSupport);用实现类的话,使用SimpleTagSupport开发相对简单,实现的方法少,如果仅实现一些简单功能,建议使用SimpleTagSupport。

2 楼 l0979365428 2006-11-08  
噢~~谢谢
另外还想继续问就是
SimpleTagSupport是2.0的类,那么在编写tag.lib的时候如果之前用的的标签版本都是1.0
现在把它写成2.0,对以前的标签会不会有影响?
例如:
引用
<taglib>
  <tlibversion>1.0</tlibversion>
[b]
 <jspversion>1.1</jspversion>
[/b]
  <shortname>Application Tag Library</shortname>
  <uri>http://localhost/cssystem</uri>
  <info>This tag library contains functionality specific to the PICCZB Application.</info>


把[b]
 <jspversion>1.1</jspversion>
[/b]
换成[b]
 <jspversion>2.0</jspversion>
[/b]

会不会有影响呢?