super.createVerbatimComponentFromBodyContent();
String value = null;
Object response = getFacesContext().getExternalContext().getResponse();
if (response instanceof InterweavingResponse) {
InterweavingResponse wrapped =
(InterweavingResponse) response;
try {
if (wrapped.isBytes()) {
wrapped.flushContentToWrappedResponse();
} else if (wrapped.isChars()) {
char[] chars = wrapped.getChars();
if (null != chars && 0 < chars.length) {
if (null != verbatim) {
value = (String) verbatim.getValue();
}
verbatim = super.createVerbatimComponent();
if (null != value) {
verbatim.setValue(value + new String(chars));
} else {
verbatim.setValue(new String(chars));
}
}
}
wrapped.resetBuffers();
} catch (IOException e) {
throw new FacesException(new JspException(
"Can't write content above <f:view> tag"
+ " " + e.getMessage()));
}