webtier@glassfish.java.net

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

From: Blaise Gervais <gervais.b_at_gmail.com>
Date: Wed, 9 Jun 2010 09:10:33 +0200

Thanks.

I was wondering if a tag can include a JSP but you said that it can so I'm
doing something wrong.
In fact, my "path" was wrong but I expected to receive an exception and not
an empty response.

2010/6/9 <webtier_at_javadesktop.org>

> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>
>


-- 
Gervais Blaise
<gervais.b_at_gmail.com>