https://issues.apache.org/bugzilla/show_bug.cgi?id=55608
Bug ID: 55608
Summary: fmt:bundle tag unnecessarily buffers body content
Product: Taglibs
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P2
Component: Standard Taglib
Assignee: [email protected]
Reporter: [email protected]
The fmt:bundle tag buffers its body content and then simply writes it all on
doEnd. This causes both unnecessary heap space consumption, and can cause out
of memory conditions on large pages where:
1) The page is surrounded by a single large <fmt:bundle ...> ... </fmt:bundle>
tag.
2) The body generates a large amount of content.
With buffer="X" and autoFlush="true", the JSP developer expects the body to be
flushed when the buffer becomes X in size. The fmt:bundle tag has a unbounded
buffer and thus this expectation is not meet.
The patch for JSTL 1.1.2 is:
In org/apache/taglibs/standard/tag/common/fmt/BundleSupport.java:
public int doStartTag() throws JspException {
locCtxt = getLocalizationContext(pageContext, basename);
// Begin removed by AO Industries, Inc.
// return EVAL_BODY_BUFFERED;
// End removed by AO Industries, Inc.
// Begin added by AO Industries, Inc.
// No need to buffer our body since it is just written in full on doEndTag.
return EVAL_BODY_INCLUDE;
// End added by AO Industries, Inc.
}
public int doEndTag() throws JspException {
// Begin removed by AO Industries, Inc.
// if (bodyContent != null) {
// try {
// pageContext.getOut().print(bodyContent.getString());
// } catch (IOException ioe) {
// throw new JspTagException(ioe.toString(), ioe);
// }
// }
// End removed by AO Industries, Inc.
return EVAL_PAGE;
}
Please include this in future releases of the taglib. It will help us work
with large sets of data using the comfortable and productive JSP environment.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]