public abstract class StateHelper extends Object
StateHelper
implementations.Modifier and Type | Field and Description |
---|---|
protected boolean |
compressViewState
Flag indicating whether or not view state should be compressed to reduce
the memory/bandwidth footprint.
|
protected char[] |
fieldEnd
This will be used the by the different
StateHelper implementations
when writing the end of the state or viewId field. |
protected char[] |
fieldMiddle
This will be used by the different
StateHelper implementations
when writing the middle of the state or viewId fields. |
protected SerializationProvider |
serialProvider
Factory for serialization streams.
|
protected char[] |
stateFieldStart
This will be used the by the different
StateHelper implementations
when writing the start of the state field. |
protected WebConfiguration |
webConfig
Access to the context init parameters that configure this application.
|
Constructor and Description |
---|
StateHelper()
Constructs a new
StateHelper instance. |
Modifier and Type | Method and Description |
---|---|
static void |
createAndStoreCryptographicallyStrongTokenInSession(javax.servlet.http.HttpSession session) |
String |
getCryptographicallyStrongTokenFromSession(javax.faces.context.FacesContext context) |
abstract Object |
getState(javax.faces.context.FacesContext ctx,
String viewId) |
protected static String |
getStateParamValue(javax.faces.context.FacesContext context)
Get our view state from this request
|
abstract boolean |
isStateless(javax.faces.context.FacesContext ctx,
String viewId) |
protected void |
writeClientWindowField(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter writer)
Write the client window state field.
|
protected void |
writeRenderKitIdField(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter writer)
If a custom
RenderKit is used, write out the ID
of the RenderKit out as a hidden field. |
abstract void |
writeState(javax.faces.context.FacesContext ctx,
Object state,
StringBuilder stateCapture)
Functionally similar to ResponseStateManager#writeState(FacesContext, Object)
with an option to write the state directly to the provided
StringBuilder
without sending any markup to the client. |
protected SerializationProvider serialProvider
Factory for serialization streams. These are pluggable via the WebConfiguration.WebContextInitParameter#SerializationProviderClass.
protected WebConfiguration webConfig
Access to the context init parameters that configure this application.
protected boolean compressViewState
Flag indicating whether or not view state should be compressed to reduce the memory/bandwidth footprint. This option is common to both types of state saving.
protected char[] stateFieldStart
StateHelper
implementations
when writing the start of the state field.protected char[] fieldMiddle
StateHelper
implementations
when writing the middle of the state or viewId fields.protected char[] fieldEnd
StateHelper
implementations
when writing the end of the state or viewId field. This value of this field is
determined by the value of the WebConfiguration.BooleanWebContextInitParameter.AutoCompleteOffOnViewState
public static void createAndStoreCryptographicallyStrongTokenInSession(javax.servlet.http.HttpSession session)
public String getCryptographicallyStrongTokenFromSession(javax.faces.context.FacesContext context)
public abstract void writeState(javax.faces.context.FacesContext ctx, Object state, StringBuilder stateCapture) throws IOException
Functionally similar to ResponseStateManager#writeState(FacesContext, Object)
with an option to write the state directly to the provided StringBuilder
without sending any markup to the client.
IOException
ResponseStateManager.writeState(javax.faces.context.FacesContext, java.lang.Object)
public abstract Object getState(javax.faces.context.FacesContext ctx, String viewId) throws IOException
IOException
ResponseStateManager.getState(javax.faces.context.FacesContext, String)
public abstract boolean isStateless(javax.faces.context.FacesContext ctx, String viewId) throws IllegalStateException
IllegalStateException
ResponseStateManager.isStateless(javax.faces.context.FacesContext, String)
protected static String getStateParamValue(javax.faces.context.FacesContext context)
Get our view state from this request
context
- the FacesContext
for the current requestprotected void writeRenderKitIdField(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer) throws IOException
If a custom RenderKit
is used, write out the ID
of the RenderKit
out as a hidden field. This will be used
when restoring the view state.
context
- the FacesContext
for the current requestwriter
- the ResponseWriter
to write toIOException
- if an error occurs writing to the clientprotected void writeClientWindowField(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer) throws IOException
context
- the Faces context.writer
- the response writer.IOException
- when an I/O error occurs.Copyright © 2010–2021 JBoss by Red Hat. All rights reserved.