jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Paransky <Alex_Paran...@citysearch.com>
Subject Problem with the PageContext.include(...) api for jsp1.2 and jsp1 .1
Date Wed, 06 Sep 2000 00:29:57 GMT

> I wish to use the PageContext.include(...) API from one of my tags.  The
> tag is nested in bodies of other tags. When I use the
> PageContext.include(...) the output goes directly to the ServletResponce
> output stream (as per spec jsp1.2 or jsp.1.1), and not to the BodyContent
> of the tag within which it is nested.
> 
> For example, if <sls:tag> produces string called "foo" (from doStartTag
> method), and <sls:include> executes PageContext.include("bar.html") method
> to include a page containing "bar" I would expect the following nesting:
> 
> <sls:tag>
>   <sls:tag>
>      <sls:include />
>   </sls:tag>
> </sls:tag>
> 
> To produce the following output:
> 
> foo
> foo
> bar
> 
> Instead, the following output is produced:
> 
> bar
> foo
> foo
> 
> It does not matter how deep I nest the sls:include, it always comes out
> first, because the bodies of surrounding tags do not get a chance to
> output until the last </sls:tag> executes
> "bodyContent.writeOut(bodyContent.getEnclosingWriter());".  This problem
> is due to the spec indicating that:
> 
> 
> include
> public abstract void include(java.lang.String relativeUrlPath)
>                       throws ServletException
> <../../../javax/servlet/ServletException.html>,
>                              java.io.IOException
> Causes the resource specified to be processed as part of the current
> ServletRequest and ServletResponse being processed by the calling Thread.
> The output of the target resources processing of the request is written
> directly to the ServletResponse output stream. 
> 
> The spec needs to change to allow PageContext.include (and forward for
> that matter) to honor the current nesting of the BodyContext as defined by
> the series of pushBody() api calls prior to the call of the
> PageContext.include API.
> 
> Please correct me if I am wrong.
> 
> Thanks.
> -AP_
>      

Mime
View raw message