Has anybody had any problems with the iterative tag execution? Even my 
simplest 'test' tag does not execute its body. doStartTag and doEndTag are 
executing fine but the doIntBody and doAfterBody are not execiting at all.

taglib.tld:

<tag>
<name>getCalendarList</name>
<tagclass>com.taror.schedule.taglib.calendar.CalendarList</tagclass>
<bodycontent>jsp</bodycontent>
<info>List...</info>


Class code:

public class LoopTag extends BodyTagSupport
{
        private int count;
        private int pos;

        public void setCount(int count)
        {
                this.count = count;
        }

        public int doStartTag()
        {
                if(count > 0)
                  return EVAL_BODY_TAG;
                else
                  return SKIP_BODY;
        }

        public int doAfterBody() throws JspException
        {
                // Iterate until the count's up
                if(++pos < count)
                return EVAL_BODY_TAG;
                else
                        return SKIP_BODY;
    }

        public int doEndTag() throws JspException
        {
                pos = 0;

                try
                {
                        if(bodyContent != null) // Check if we even entered the body
                                bodyContent.writeOut(bodyContent.getEnclosingWriter());
                }
                catch(java.io.IOException e)
                {
                        throw new JspException("IO Error: " + e.getMessage());
                }

                return EVAL_PAGE;
        }
}

JSP:

<%@ page session="false" %>
<%@ taglib uri="ScheduleUtil" prefix="schedule" %>
<html>
        <head>
                <title>Calendar List</title>
        </head>
        <body>
                <table>
                        <schedule:getCalendarList>
                                        <tr>
                                        <td>lksdjhg </td>
                                        </tr>
                        </schedule:getCalendarList>
                </table>
        </body>
</html>





_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


Reply via email to