Package javax.faces.application

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


        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);
        }

        if (org.apache.myfaces.shared_tomahawk.config.MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isAutoScroll())
        {
            HtmlRendererUtils.renderAutoScrollHiddenInput(facesContext, writer);
View Full Code Here


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

    StateManager stateManager = facesContext.getApplication().getStateManager();
    Object view = stateManager.saveView(facesContext);
    stateManager.writeState(facesContext, view);
  }

  private static void ensureContentTypeHeader(FacesContext facesContext, String charset, String contentType) {
    StringBuilder sb = new StringBuilder(contentType);
    if (charset == null) {
View Full Code Here

                            {
                                stateStr = null;
                            }
                            else
                            {
                                stateMgr.writeState(context, stateObj);
                                stateStr = stateWriter.getAndResetBuffer();
                            }

                            int start = 0;
View Full Code Here

        .saveSerializedView(context);
    if (null != writer && null != serializedView) {
      StringWriter bufWriter = new StringWriter();
      ResponseWriter cloneWithWriter = writer.cloneWithWriter(bufWriter);
      context.setResponseWriter(cloneWithWriter);
      stateManager.writeState(context, serializedView);
      cloneWithWriter.flush();
      if (bufWriter.getBuffer().length() > 0) {
        context.getExternalContext().getRequestMap().put(
            AjaxViewHandler.SERIALIZED_STATE_KEY,
            bufWriter.toString());
View Full Code Here

        if (stateManager.isSavingStateInClient(facesContext))
        {
            //render state parameters
            //TODO: Optimize saveSerializedView call, because serialized view is built twice!
            StateManager.SerializedView serializedView = stateManager.saveSerializedView(facesContext);
            stateManager.writeState(facesContext, serializedView);
        }

        if (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isAutoScroll())
        {
            JavascriptUtils.renderAutoScrollHiddenInput(writer);
View Full Code Here

               {
                  stateStr = null;
               }
               else
               {
                  stateMgr.writeState(facesContext, stateObj);
                  stateStr = StateWriterControl.getAndResetBuffer();
               }

               int start = 0;
View Full Code Here

                    context.getResponseWriter().write(FORM_STATE_MARKER);
                }
            }
            else
            {
                stateManager.writeState(context, new Object[2]);
            }
        }
        else
        {
            // Only write state marker if javascript view state is disabled
View Full Code Here

            facesContext.getResponseWriter().write(FORM_STATE_MARKER);
        }
        }
        else
        {
            stateManager.writeState(facesContext, new Object[2]);
        }
    }

    /**
     * Writes the response and replaces the state marker tags with the state information for the current context
View Full Code Here

                            {
                                stateStr = null;
                            }
                            else
                            {
                                stateMgr.writeState(context, stateObj);
                                stateStr = stateWriter.getAndResetBuffer();
                            }

                            int start = 0;
View Full Code Here

            ResponseWriter realWriter = facesContext.getResponseWriter();
            facesContext.setResponseWriter(realWriter.cloneWithWriter(stateWriter));

            Object serializedView = stateManager.saveView(facesContext);

            stateManager.writeState(facesContext, serializedView);
            facesContext.setResponseWriter(realWriter);

            StringBuilder contentBuffer = getStringBuilder();
            String state = stateWriter.getBuffer().toString();
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.