webtier@glassfish.java.net

Custom JSTL Tag. Include page from a tag

From: Blaise Gervais <gervais.b_at_gmail.com>
Date: Tue, 8 Jun 2010 15:38:27 +0200

Hi everyone,

I have a custom tag who will include another JSP page. But when I use this
tag, the result page is always blank without any html tag and no exception.
I have tried to write a link instead of including the page and the link goes
to the page to include so my path is correct.
How can I include (and evaluate the included content) from a custom tag ?

Here is my "doStartTag" content. The full tag can be found as attachment.

> public int doStartTag() throws JspException {

 try {

 StringBuilder path = new StringBuilder()

 .append("../../extended/").append(extended)

 .append('/').append(part).append(".jsp");

 pageContext.getOut().write("<a href="+path.toString()+">Page</a>");

 pageContext.include(path.toString(), true);

 } catch (Exception e) {

 e.printStackTrace();

 }

 return EVAL_BODY_AGAIN;

}

// doEndTag return "EVAL_PAGE"


Thanks

-- 
Gervais Blaise
<gervais.b_at_gmail.com>