/** * <p>The default behavior of this method is to * call {@link StateManager#saveSerializedView(javax.faces.context.FacesContext)} * on the wrapped {@link StateManager} object.</p> * * @see StateManager#saveSerializedView(javax.faces.context.FacesContext) * @since 1.2 */ @Override public SerializedView saveSerializedView(FacesContext context) { return getWrapped().saveSerializedView(context); }
@SuppressWarnings("deprecation") @Override public StateManager.SerializedView saveSerializedView(FacesContext context) { return getWrapped().saveSerializedView(context); }
/** * <p>The default behavior of this method is to * call {@link StateManager#saveSerializedView(javax.faces.context.FacesContext)} * on the wrapped {@link StateManager} object.</p> * * @see StateManager#saveSerializedView(javax.faces.context.FacesContext) * @since 1.2 */ @Override public SerializedView saveSerializedView(FacesContext context) { return getWrapped().saveSerializedView(context); }
/** * <p>The default behavior of this method is to * call {@link StateManager#saveSerializedView(javax.faces.context.FacesContext)} * on the wrapped {@link StateManager} object.</p> * * @see StateManager#saveSerializedView(javax.faces.context.FacesContext) * @since 1.2 */ @Override public SerializedView saveSerializedView(FacesContext context) { return getWrapped().saveSerializedView(context); }
/** * <p> * The default behavior of this method is to call * {@link StateManager#saveSerializedView(javax.faces.context.FacesContext)} on the wrapped * {@link StateManager} object. * </p> * * @see StateManager#saveSerializedView(javax.faces.context.FacesContext) * @since 1.2 */ @Override public SerializedView saveSerializedView(FacesContext context) { return getWrapped().saveSerializedView(context); }
/** * <p>The default behavior of this method is to * call {@link StateManager#saveSerializedView(javax.faces.context.FacesContext)} * on the wrapped {@link StateManager} object.</p> * * @see StateManager#saveSerializedView(javax.faces.context.FacesContext) * @since 1.2 */ public SerializedView saveSerializedView(FacesContext context) { return getWrapped().saveSerializedView(context); }
/** * <p>The default behavior of this method is to * call {@link StateManager#saveSerializedView(javax.faces.context.FacesContext)} * on the wrapped {@link StateManager} object.</p> * * @see StateManager#saveSerializedView(javax.faces.context.FacesContext) * @since 1.2 */ public SerializedView saveSerializedView(FacesContext context) { return getWrapped().saveSerializedView(context); }
public StateManager.SerializedView saveSerializedView(FacesContext context) { return getWrapped().saveSerializedView(context); }
/** * <p>The default behavior of this method is to * call {@link StateManager#saveSerializedView(javax.faces.context.FacesContext)} * on the wrapped {@link StateManager} object.</p> * * @see StateManager#saveSerializedView(javax.faces.context.FacesContext) * @since 1.2 */ @Override public SerializedView saveSerializedView(FacesContext context) { return getWrapped().saveSerializedView(context); }
/** * <p> * The default behavior of this method is to call * {@link StateManager#saveSerializedView(javax.faces.context.FacesContext)} on the wrapped * {@link StateManager} object. * </p> * * @see StateManager#saveSerializedView(javax.faces.context.FacesContext) * @since 1.2 */ @Override public SerializedView saveSerializedView(FacesContext context) { return getWrapped().saveSerializedView(context); }
/** * <p> * The default behavior of this method is to call * {@link StateManager#saveSerializedView(javax.faces.context.FacesContext)} on the wrapped * {@link StateManager} object. * </p> * * @see StateManager#saveSerializedView(javax.faces.context.FacesContext) * @since 1.2 */ @Override public SerializedView saveSerializedView(FacesContext context) { return getWrapped().saveSerializedView(context); }
/** * <p> * The default behavior of this method is to call * {@link StateManager#saveSerializedView(javax.faces.context.FacesContext)} on the wrapped * {@link StateManager} object. * </p> * * @see StateManager#saveSerializedView(javax.faces.context.FacesContext) * @since 1.2 */ @Override public SerializedView saveSerializedView(FacesContext context) { return getWrapped().saveSerializedView(context); }
/** * Save the view state of the request contained in given faces context. * <p> * This implementation directly uses the {@link StateManager} and does not call * {@link ViewHandler#writeState(FacesContext)} since some ViewHanlder implementations (e.g. Facelets) only expect * writeState to be called when {@link ViewHandler#renderView(FacesContext, UIViewRoot)} has been called. * * @since 1.0.6 */ protected void saveViewState(FacesContext context) throws IOException { // note that we're not doing StateManager.writeState() since that seems to cause problems because no // response writer has been initialized and there doesn't seem to be an implementation independent way // to initialize the response writer // this will likely not work when using JSF client state saving context.getApplication().getStateManager().saveSerializedView(context); }
/** * Returns an object that is sufficient to recreate the component tree that is the viewroot of the specified * context. * <p> * The return value is suitable for passing to method writeState. * * @since 1.2 */ @Deprecated public Object saveView(FacesContext context) { StateManager.SerializedView serializedView = saveSerializedView(context); if (serializedView == null) { return null; } Object[] structureAndState = new Object[2]; structureAndState[0] = serializedView.getStructure(); structureAndState[1] = serializedView.getState(); return structureAndState; }
/** * Returns an object that is sufficient to recreate the component tree that is the viewroot of * the specified context. * <p> * The return value is suitable for passing to method writeState. * * @since 1.2 */ public Object saveView(FacesContext context) { StateManager.SerializedView serializedView = saveSerializedView(context); if (serializedView == null) return null; Object[] structureAndState = new Object[2]; structureAndState[0] = serializedView.getStructure(); structureAndState[1] = serializedView.getState(); return structureAndState; }
@Override public SerializedView saveSerializedView(FacesContext facesContext) { if ( Contexts.isPageContextActive() ) { //store the page parameters in the view root Pages.instance().updateStringValuesInPageContextUsingModel(facesContext); } return stateManager.saveSerializedView(facesContext); }
/** * JSF 1.1 version of state saving */ public javax.faces.application.StateManager.SerializedView saveSerializedView(FacesContext context) { if (context.getViewRoot().isTransient()) { return null; } if (!JsfUtils.isFlowRequest()) { return delegate.saveSerializedView(context); } SerializedView view = (SerializedView) saveView(context); return new javax.faces.application.StateManager.SerializedView(view.treeStructure, view.componentState); }
public void afterPhase(PhaseEvent phaseEvent) { FacesContext facesContext = phaseEvent.getFacesContext(); Map map = facesContext.getExternalContext().getRequestParameterMap(); if(map.containsKey("excelExportTableId")) { String tableId = (String) map.get("excelExportTableId"); HtmlDataTable dataTable = (HtmlDataTable) ComponentUtils.findComponentById( facesContext, facesContext.getViewRoot(), tableId ); HSSFWorkbook generatedExcel = generateExcel( facesContext, dataTable ); try { Object contextResponse = facesContext.getExternalContext().getResponse(); if(contextResponse instanceof HttpServletResponse) writeExcelOutput(generatedExcel,(HttpServletResponse)contextResponse); else if(contextResponse instanceof RenderResponse) writeExcelOutput(generatedExcel,(RenderResponse)contextResponse); facesContext.getApplication().getStateManager().saveSerializedView(facesContext); facesContext.responseComplete(); } catch (Exception e) { throw new RuntimeException( e ); } } }
public int doEndTag() throws JspException { FacesContext context = FacesContext.getCurrentInstance(); AssertionUtil.assertNotNull("FacesContext", context); StateManager stateManager = context.getApplication().getStateManager(); stateManager.saveSerializedView(context); JspWriter out = pageContext.getOut(); try { out.flush(); } catch (IOException ignore) { //throw new IORuntimeException(e); } int rc = super.doEndTag(); ResponseWriter responseWriter = context.getResponseWriter(); AssertionUtil.assertNotNull("ResponseWriter", responseWriter); try { responseWriter.endDocument(); } catch (IOException ignore) { //throw new JspException(e.getMessage()); } final HttpServletRequest request = (HttpServletRequest) pageContext .getRequest(); HttpSession session = request.getSession(true); if (session != null) { final String encoding = PageContextUtil .getCharacterEncoding(pageContext); session.setAttribute(ViewHandler.CHARACTER_ENCODING_KEY, encoding); } return rc; }
SerializedView view = stateManager.saveSerializedView(context);