webtier@glassfish.java.net

Re: [webtier] Custom JSTL Tag. Include page from a tag

From: <webtier_at_javadesktop.org>
Date: Tue, 08 Jun 2010 16:29:48 PDT

I simplified your test case further:

package test;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

public class TTag extends TagSupport {

    @Override
    public int doStartTag() throws JspException {

        try {
            pageContext.getOut().write("Including test.jsp ");
            pageContext.include("test.jsp", true);
            pageContext.getOut().write("After test.jsp ");
        } catch (Exception e) {
            throw new JspException(e);
        }
        return EVAL_BODY_AGAIN;
    }
}

The include works as expected. No idea why it didn't work for you.

BTW, doStartTag should not return EVAL_BODY_AGAIN, it should return either SKIP_BODY or EVAL_BODY_INCLUDE.
[Message sent by forum member 'kchung']

http://forums.java.net/jive/thread.jspa?messageID=473452