Package javax.faces.application

Examples of javax.faces.application.StateManager.saveSerializedView()


   
    writer.write("<state>");
    RendererUtils.startCDATA(facesContext);
   
    StateManager stateManager = facesContext.getApplication().getStateManager();
    SerializedView serializedView = stateManager.saveSerializedView(facesContext);
    Object stateArray[] = {serializedView.getStructure(), serializedView.getState()};

    stateManager.writeState(facesContext, stateArray);
   
    RendererUtils.endCDATA(facesContext);
View Full Code Here


            //end the document
            buffResponsewriter.endDocument();

            //save the view
            StateManager stateManager = context.getApplication().getStateManager();
            StateManager.SerializedView serializedview = stateManager.saveSerializedView(context);

            ResponseWriter responsewriter = context.getRenderKit()
                    .createResponseWriter(response.getWriter(), null, response.getCharacterEncoding());
            //push response writer to the faces context
            context.setResponseWriter(responsewriter);
View Full Code Here

        StateManager stateManager = facesContext.getApplication().getStateManager();
        org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlRendererUtils.writePrettyLineSeparator(facesContext);

        //TODO: Optimize saveSerializedView call, because serialized view is built twice!
        StateManager.SerializedView serializedView = stateManager.saveSerializedView(facesContext);
        // Adam Winer - TOMAHAWK-253: Ideally, this code should be refactored so that the server-side code is also calling StateManager.writeState() too
        //    it's a significant problem that DummyFormUtils has hardcoded knowledge of how the StateManager works.
        if (stateManager.isSavingStateInClient(facesContext)) {
            //render state parameters
            stateManager.writeState(facesContext, serializedView);
View Full Code Here

        writeAjaxResponse(facesContext, content.toString());

        final StateManager stateManager
            = facesContext.getApplication().getStateManager();
        if (!stateManager.isSavingStateInClient(facesContext)) {
          stateManager.saveSerializedView(facesContext);
        }
        facesContext.responseComplete();

      } catch (IOException e) {
        LOG.error("Exception while processing Ajax", e);
View Full Code Here

                int end = content.indexOf(STATE_KEY);
                // See if we can find any trace of the saved state.
                // If so, we need to perform token replacement
                if (end >= 0) {
                    // save state
                    Object stateObj = stateMgr.saveSerializedView(context);
                    String stateStr;
                    if (stateObj == null) {
                        stateStr = null;
                    } else {
                        stateMgr.writeState(context,
View Full Code Here

                    // detect any saved state, force a call to
                    // saveSerializedView() in case we're using the old
                    // pure-server-side state saving
                    if ((FacesAPI.getVersion() < 12)
                        && !stateMgr.isSavingStateInClient(context)) {
                        stateMgr.saveSerializedView(context);
                    }
                }
            }

            time = System.currentTimeMillis() - time;
View Full Code Here

    ResponseWriter stateWriter = renderKit.createResponseWriter(jsfState, null, null);
    facesContext.setResponseWriter(stateWriter);

    StateManager stateManager = facesContext.getApplication().getStateManager();
    StateManager.SerializedView serializedView
        = stateManager.saveSerializedView(facesContext);
    stateManager.writeState(facesContext, serializedView);
    return jsfState.toString();
  }

  private static void ensureContentTypeHeader(FacesContext facesContext, String charset, String contentType) {
View Full Code Here

      _oldViewHandler.writeState(context);
  } else {
      // b/c we pre-processed the ViewTree, we can just add it...
      StateManager stateManager =
    context.getApplication().getStateManager();
      SerializedView view = stateManager.saveSerializedView(context);

      // New versions of JSF 1.2 changed the contract so that state is
      // always written (client and server state saving)
      stateManager.writeState(context, view);
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.