You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2020/01/16 18:33:35 UTC

[Bug 64081] Fix for 49464 looks to introduced a regression on jstl's import tag support under certain condition

https://bz.apache.org/bugzilla/show_bug.cgi?id=64081

fuminzhou@crd.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from fuminzhou@crd.com ---
A description of the issue:
Fix to bug 49464 looks to introduced a new bug/regression for jstl import tag
under certain conditions:
1. When jstl's fmt:setLocale is also used.
2. javax.servlet.jsp.jstl-1.2.3.jar is used. (later test indicates the issue
happens with javax.servlet.jsp.jstl-1.2.5.jar as well).

The issue behavior:
For the import tag such as
<c:import var="var1" url="/sample.txt"/>
the expectation is var1 would be populated with the contents of sample.txt -
and the page itself not getting the file contents.

However, with tomcat 9.0.26 (with the bug 49464 fix), it is observed that the
var1 is left empty, while the containing jsp's generated result html would
contain the contents of the sample.txt.

Investigation:
under the above mentioned conditions, 
1. Tomcat's org.apache.catalina.servlets.DefaultServlet at about line 1025
(9.0.26), 
"outputEncoding != org.apache.coyote.Constants.DEFAULT_BODY_CHARSET.name()"
would yield a true even when the contents of both left and right sides are the
same.
2. The boolean outputEncodingSpecified being true would further branch the code
flow in about line 1108-1112 to pw.flush.
3. these looks to flush the contents into the response, and voided the internal
buffer which is used to populate the variable.
And the result is the result html contents get the import contents, while the
variable does not.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org