Package javax.faces.application

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


    {
        setViewRoot("/index.jsp");
        // simulate that this is the 2nd request for this page
        // so that we will go through all 6 phases
        StateManager stateManager = facesContext.getApplication().getStateManager();
        stateManager.saveSerializedView(facesContext);
        InstrumentingPhaseListener listener = new InstrumentingPhaseListener();
        listener.setEventPhaseId(PhaseId.INVOKE_APPLICATION);
        listener.setBefore(false);
        listener.setAfter(true);
        listener.setRender(true);
View Full Code Here


    {
        setViewRoot("/index.jsp");
        // simulate that this is the 2nd request for this page
        // so that we will go through all 6 phases
        StateManager stateManager = facesContext.getApplication().getStateManager();
        stateManager.saveSerializedView(facesContext);
        InstrumentingPhaseListener listener = new InstrumentingPhaseListener();
        listener.setEventPhaseId(PhaseId.INVOKE_APPLICATION);
        listener.setBefore(true);
        listener.setAfter(false);
        listener.setComplete(true);
View Full Code Here

    {
        setViewRoot("/index.jsp");
        // simulate that this is the 2nd request for this page
        // so that we will go through all 6 phases
        StateManager stateManager = facesContext.getApplication().getStateManager();
        stateManager.saveSerializedView(facesContext);
        InstrumentingPhaseListener listener = new InstrumentingPhaseListener();
        listener.setEventPhaseId(PhaseId.INVOKE_APPLICATION);
        listener.setBefore(false);
        listener.setAfter(true);
        listener.setComplete(true);
View Full Code Here

        // set the view root
        setViewRoot("/index.jsp");
        // simulate that this is the 2nd request for this page
        // so that we will go through all 6 phases
        StateManager stateManager = facesContext.getApplication().getStateManager();
        stateManager.saveSerializedView(facesContext);
        InstrumentingPhaseListener listener = new InstrumentingPhaseListener();
        lifecycle.addPhaseListener(listener);
        servlet.service(this.request, this.response);
        // assert the phases were hit
        assertEquals(6, listener.getBeforePhases().size());
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

                // 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;
                    }
View Full Code Here

                // 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;
                    }
View Full Code Here

                // 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;
                    }
View Full Code Here

        int rc = super.doEndTag(namespaceURI, localName, qName);

        StateManager stateManager = getApplication().getStateManager();
        StateManager.SerializedView view;
        try {
            view = stateManager.saveSerializedView(getFacesContext());
        } catch (IllegalStateException e) {
            throw new SAXException(e);
        } catch (Exception e) {
            throw new SAXException("Could not save faces view", e);
        }
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

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.