try
{
RequestCycle requestCycle;
if (oldRequestCycle == null || message instanceof IWebSocketPushMessage)
{
RequestCycleContext context = new RequestCycleContext(webRequest, webResponse,
application.getRootRequestMapper(), application.getExceptionMapperProvider().get());
requestCycle = application.getRequestCycleProvider().get(context);
requestCycle.getUrlRenderer().setBaseUrl(baseUrl);
ThreadContext.setRequestCycle(requestCycle);