Object response = facesContext.getExternalContext().getResponse();
String wrappedOutput;
if (response instanceof ViewResponseWrapper)
{
ViewResponseWrapper wrappedResponse = (ViewResponseWrapper) response;
wrappedOutput = wrappedResponse.toString();
if (wrappedOutput != null && wrappedOutput.length() > 0)
{
String componentvalue = null;
if (component != null)
{
//save the Value of the Bodycontent
componentvalue = (String) component.getValue();
}
component = super.createVerbatimComponent();
if (componentvalue != null)
{
component.setValue(wrappedOutput + componentvalue);
}
else
{
component.setValue(wrappedOutput);
}
wrappedResponse.reset();
}
}
return component;
}