{
_LOG.finer("UIViewRoot for token {0} already exists. Bypassing restoreState", token);
return root;
}
StateManagementStrategy sms = _getStateManagementStrategy(context, viewId);
if (sms!= null)
{
// TODO This is a hack because stateManagementStrategy doesn't take
// a state object as a param, instead it always asks the responseStateManager
// for the state, so push the state onto the request where the CoreResponseStateManager
// can return it. We will file a bug agains JSF 2.0 asking that the
// stateManagementStrategy deprecate the current restoreView method in favor of
// a restoreView method that takes state
try
{
requestMap.put(RESPONSE_STATE_MANAGER_STATE_KEY, viewState.getViewState(context));
root = sms.restoreView(context, viewId, renderKitId);
}
finally
{
requestMap.remove(RESPONSE_STATE_MANAGER_STATE_KEY);
}
return root;
}
else
{
Object[] stateArray = (Object[])viewState.getViewState(context);
structure = stateArray[0];
state = stateArray[1];
}
}
else
{
StateManagementStrategy sms = _getStateManagementStrategy(context, viewId);
if (sms!= null)
{
return sms.restoreView(context, viewId, renderKitId);
}
Object[] stateArray = (Object[])rsm.getState(context, viewId);
structure = stateArray[0];
state = stateArray[1];