You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for the xsl file to properly be imported into the variable.
Actual outcome:
The xsl file is loaded as an empty string, which in turn crashes the x:transform task because it expects an xslt string.
Additional information:
I've done some debugging. What happens is that in a Tomcat 9.0.0 change (apache/tomcat@25462b8), Tomcat now calls flush() on the PrintWriter that is used to return the request data. This in turn bubbles down to the ImportSupportWrapper, where a change 4 years (javaee/jstl-api@e41c5e8) overrides the flush() method to reset the ByteArrayOutputStream, which in turn sets the internal byte counter to 0. This all happens during the RequestDispatcher.include() call in the acquireString() method of ImportSupport. However, due to the way this ImportSupportWrapper is used, the ByteArrayOutputStream is reused after this in the getString() method. This getString() in turn calls the toString() of the ByteArrayOutputStream, which in turn uses the internal byte counter to determine how much needs to be converted to a string. Because this counter has been reset back to 0, it doesn't include any bytes in the response, leading to an empty String being returned.
The text was updated successfully, but these errors were encountered:
Environment:
Steps to reproduce:
Put this in a struts 2 jsp:
and put this in the action:
phaseLog.log: String contents:
phaseLog.formattingData: String. Should be a relative URL to the below xsl file. Mine referred to /xslt/ant/log.xsl.
log.zip
Expected result:
for the xsl file to properly be imported into the variable.
Actual outcome:
The xsl file is loaded as an empty string, which in turn crashes the x:transform task because it expects an xslt string.
Additional information:
I've done some debugging. What happens is that in a Tomcat 9.0.0 change (apache/tomcat@25462b8), Tomcat now calls flush() on the PrintWriter that is used to return the request data. This in turn bubbles down to the ImportSupportWrapper, where a change 4 years (javaee/jstl-api@e41c5e8) overrides the flush() method to reset the ByteArrayOutputStream, which in turn sets the internal byte counter to 0. This all happens during the RequestDispatcher.include() call in the acquireString() method of ImportSupport. However, due to the way this ImportSupportWrapper is used, the ByteArrayOutputStream is reused after this in the getString() method. This getString() in turn calls the toString() of the ByteArrayOutputStream, which in turn uses the internal byte counter to determine how much needs to be converted to a string. Because this counter has been reset back to 0, it doesn't include any bytes in the response, leading to an empty String being returned.
The text was updated successfully, but these errors were encountered: