parameters.set("name", name);
final RenderPageRequestHandler handler = new RenderPageRequestHandler(new PageProvider(
pageClass, parameters), RedirectPolicy.NEVER_REDIRECT);
final PageRenderer pageRenderer = getApplication().getPageRendererProvider().get(handler);
RequestCycle originalRequestCycle = getRequestCycle();
BufferedWebResponse tempResponse = new BufferedWebResponse(null);
RequestCycleContext requestCycleContext = new RequestCycleContext(originalRequestCycle.getRequest(),
tempResponse, getApplication().getRootRequestMapper(), getApplication().getExceptionMapperProvider().get());
RequestCycle tempRequestCycle = new RequestCycle(requestCycleContext);
final Response oldResponse = originalRequestCycle.getResponse();
try
{
originalRequestCycle.setResponse(tempResponse);
pageRenderer.respond(tempRequestCycle);
}
finally
{
originalRequestCycle.setResponse(oldResponse);
}