Package javax.faces.application

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


        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


                    {
                        if (url_marker == -1 || (form_marker != -1 && form_marker < url_marker))
                        {
                            //replace form_marker
                            realWriter.write(bodyStr, lastMarkerEnd, form_marker - lastMarkerEnd);
                            stateManager.writeState(facesContext, serializedView);
                            lastMarkerEnd = form_marker + JspViewHandlerImpl.FORM_STATE_MARKER_LEN;
                            form_marker = bodyStr.indexOf(JspViewHandlerImpl.FORM_STATE_MARKER, lastMarkerEnd);
                        }
                        else
                        {
View Full Code Here

        facesContext.setResponseWriter(jsfStateWriter);

        final StateManager stateManager
            = facesContext.getApplication().getStateManager();
        StateManager.SerializedView serializedView = stateManager.saveSerializedView(facesContext);
        stateManager.writeState(facesContext, serializedView);

        contentWriter.startElement(HtmlConstants.SCRIPT, null);
        contentWriter.writeAttribute(HtmlAttributes.TYPE, "text/javascript", null);
        contentWriter.write("Tobago.replaceJsfState(\"");
        contentWriter.write(StringUtils.replace(StringUtils.replace(jsfState.toString(), "\"", "\\\""), "\n", ""));
View Full Code Here

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

                            int start = 0;
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

            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

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

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

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

        facesContext.setResponseWriter(jsfStateWriter);

        final StateManager stateManager
            = facesContext.getApplication().getStateManager();
        StateManager.SerializedView serializedView = stateManager.saveSerializedView(facesContext);
        stateManager.writeState(facesContext, serializedView);

        String stateValue = jsfState.toString();
        if (stateValue.length() > 0) {
          // in case of inputSuggest jsfState.lenght is 0
          // inputSuggest is a special case, because the form is not included in request.
View Full Code Here

    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) {
    StringBuilder sb = new StringBuilder(contentType);
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);

    String state = stateWriter.getBuffer().toString();

    ExternalContext extContext = facesContext.getExternalContext();
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.