if (log.isLoggable(Level.FINEST)) log.finest("Entering writeState");
UIViewRoot uiViewRoot = facesContext.getViewRoot();
//save state in response (client)
RenderKit renderKit = getRenderKitFactory().getRenderKit(facesContext, uiViewRoot.getRenderKitId());
ResponseStateManager responseStateManager = renderKit.getResponseStateManager();
if (isLegacyResponseStateManager(responseStateManager))
{
responseStateManager.writeState(facesContext, serializedView);
}
else if (!isSavingStateInClient(facesContext))
{
Object[] state = new Object[2];
state[JSF_SEQUENCE_INDEX] = Integer.toString(getNextViewSequence(facesContext), Character.MAX_RADIX);
responseStateManager.writeState(facesContext, state);
}
else
{
Object[] state = new Object[2];
state[0] = serializedView.getStructure();
state[1] = serializedView.getState();
responseStateManager.writeState(facesContext, state);
}
if (log.isLoggable(Level.FINEST)) log.finest("Exiting writeState");
}