tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "eee" <e...@starsolutions.com.my>
Subject RE: Problem with the PageContext.include(...) api for jsp1.2 and jsp1.1
Date Tue, 26 Sep 2000 05:31:50 GMT
Hi Please let me know how to get of this mailing list..thanks

-----Original Message-----
From: Alex Paransky [mailto:Alex_Paransky@citysearch.com]
Sent: Wednesday, September 06, 2000 6:00 AM
To: 'jsp-spec-comments@eng.sun.com'
Cc: 'general@jakarta.apache.org' 'tomcat-dev@jakarta.apache.org'
<tomcat-dev@jakarta.apache.org>; 'tomcat-user@jakarta.apache.org'
Subject: Problem with the PageContext.include(...) api for jsp1.2 and
jsp1.1
Importance: High


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