Bug 65491 - Behavior differences with c:import when flushing out data
Summary: Behavior differences with c:import when flushing out data
Status: NEW
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: 1.2.5
Hardware: PC Mac OS X 10.1
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-09 15:54 UTC by Volodymyr Siedlecki
Modified: 2021-08-09 15:54 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volodymyr Siedlecki 2021-08-09 15:54:11 UTC
Hello,

I would like some clarification on what behavior is correct here, given the JSPs below.  There's a difference between the Tomcat/Apache Taglibs & the Eclipse Foundation's Tag Library implementations. 


test.jsp:

<%@ page session="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<TABLE border>
    <TR>
        <TD>Hello world</TD>
        <TD><%=System.currentTimeMillis()%></TD>
    </TR>
    <tr>
        <td>The import</td>
        <td><c:import url="imported-file.jsp" var="foo"/></td>
    </tr>
    <tr>
        <td>The output</td>
        <td><c:out value="${foo}"/></td>
    </tr>
</TABLE>

imported-file.jsp:

<%@ page session="false" %>
Start of test a
<% out.flush(); %>
End of test a


Should anything be displayed when importing a file, even when an out.flush() is called? File contents should only be stored in the variable, until is outputted? 

I also created a sister issue here (with screenshots) -- https://github.com/eclipse-ee4j/jstl-api/issues/153 

The spec appears ambiguous on this scenario, so I hope someone here can provide some insight?  What is the correct behavior here? 


In the Eclipse's Impl, calling out.flush within the import flushes that straight to the page.  

Eclipse (I testing using EE9's 2.0, but it's also the similar for the 1.2.7 version):
https://github.com/eclipse-ee4j/jstl-api/blob/1.2.7/impl/src/main/java/org/apache/taglibs/standard/tag/common/core/ImportSupport.java


https://github.com/eclipse-ee4j/jstl-api/blob/1.2.7/impl/src/main/java/org/apache/taglibs/standard/tag/common/core/ImportSupport.java#L514-L521

Apache (version 1.2.5):
https://github.com/apache/tomcat-taglibs-standard/blob/taglibs-standard-1.2.5/impl/src/main/java/org/apache/taglibs/standard/tag/common/core/ImportSupport.java#L470


Thank you!