// component's markup in a manner safe for transport inside CDATA block
encodingBodyResponse.reset();
RequestCycle.get().setResponse(encodingBodyResponse);
// Initialize temporary variables
final Page page = component.findParent(Page.class);
if (page == null)
{
// dont throw an exception but just ignore this component, somehow
// it got removed from the page.
LOG.debug("component: " + component + " with markupid: " + markupId +
" not rendered because it was already removed from page");
return;
}
page.startComponentRender(component);
try
{
component.prepareForRender();
// render any associated headers of the component
writeHeaderContribution(response, component);
}
catch (RuntimeException e)
{
try
{
component.afterRender();
}
catch (RuntimeException e2)
{
// ignore this one could be a result off.
}
// Restore original response
RequestCycle.get().setResponse(response);
encodingBodyResponse.reset();
throw e;
}
try
{
component.render();
}
catch (RuntimeException e)
{
RequestCycle.get().setResponse(response);
encodingBodyResponse.reset();
throw e;
}
page.endComponentRender(component);
// Restore original response
RequestCycle.get().setResponse(response);
response.write("<component id=\"");