"Elisabeth Julg" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I have problem using the same Tag with body and without body.
>
> In my application, I use BodyTagSupport :
>
>   - Declaration :
>      <tag>
> <name>select</name>
> <tag-class>appli.jsp.HtmlSelectTag</tag-class>
> <body-content>JSP</body-content>
>       <attribute><name>name</name><required>true</required></attribute>
>     </tag>
>
>    - Code : public class HtmlSelectTag extends BodyTagSupport
>             {
>                public int doAfterBody() throws JspException
>                {
>                  BodyContent body=getBodyContent();
>                  String valeur=body.getString();
>                  body.clearBody();
>
>                  JspWriter out=getPreviousOut();
>                  out.println(.......);
>                  return SKIP_BODY;
>                }
>             }
>      - Utilisation :
>          <appli:select>Corps</appli:select> ====> It works fine.
>          <appli:select/>                    ====> Doesn't work
>          <appli:select></appli:select>      ====> Doesn't work
>         The two last exemples don't work with tomcat's version 4.1.x, but
> work with 4.0.x.
>
> Have you an idea ? Is a bug of new version of Tomcat, or I have made a
> mistake ?

As I understand it, this is a bug in Tomcat 4.0.x, which has been fixed in
4.1.x.  See section 10.2.2 of the JSP-1.2 spec under the heading "Empty and
Non-Empty Actions".

The bad news for you is that you will have to change your TagLib to conform
to the spec.  This probably means moving your "doAfterBody" code into a
seperate method called from both "doAfterBody", and "doEndTag" (likely with
a flag to determine who calls).

>
> Thanks,
>
> Elisabeth
> Toulouse





--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to