定义t标记,例如
  <tag>
    <name>t</name>
    <tagclass>mypack.tTag</tagclass>
    <bodycontent>tagdependent</bodycontent>
    <info>get a substring from beginIndex to endIndex</info>
    <attribute>
      <name>beginIndex</name>
      <required>true</required>
    </attribute>
    <attribute>
      <name>endIndex</name>
      <required>true</required>
    </attribute>
  </tag>
定义标记处理类tTag
tTag继承BodyTagSupport类
在doEndTag()方法里:
调用getBodyContent()方法,取得<tTag></tTag>标记里包含的字符串
再用substring方法,根据tTag标记的beginIndex和endIndex属性取得子串.

解决方案 »

  1.   

    上面发的有地方打错了,重发的.
    定义t标记,例如
      <tag>
        <name>t</name>
        <tagclass>mypack.tTag</tagclass>
        <bodycontent>tagdependent</bodycontent>
        <info>get a substring from beginIndex to endIndex</info>
        <attribute>
          <name>beginIndex</name>
          <required>true</required>
        </attribute>
        <attribute>
          <name>endIndex</name>
          <required>true</required>
        </attribute>
      </tag>
    定义标记处理类tTag
    tTag继承BodyTagSupport类
    在doEndTag()方法里:
    调用getBodyContent()方法,取得<t></t>标记里包含的字符串
    再用substring方法,根据<t>标记的beginIndex和endIndex属性取得子串.