public static final String RENDER_KIT_ID_PARAM = "javax.faces.RenderKitId";
public static final String VIEW_STATE_PARAM = "javax.faces.ViewState";
public void writeState(FacesContext context, Object state) throws IOException
{
SerializedView view;
if (state instanceof SerializedView)
{
view = (SerializedView)state;
}
else if (state instanceof Object[])
{
Object[] structureAndState = (Object[])state;
if (structureAndState.length == 2)
{
Object structureObj = structureAndState[0];
Object stateObj = structureAndState[1];
StateManager stateManager = context.getApplication().getStateManager();
view = stateManager.new SerializedView(structureObj, stateObj);
}
else
{
throw new IOException("The state should be an array of Object[] of lenght 2");
}