JSF-Spring

de.mindmatters.faces
Class FacesUtils

java.lang.Object
  extended by de.mindmatters.faces.FacesUtils

public final class FacesUtils
extends java.lang.Object

Miscellaneous faces utility methods. Mainly for internal use within the framework.

Author:
Andreas Kuhrwahl

Field Summary
static java.lang.String TRANSIENT_PARAM
          Parameter name for the transient flag.
static java.lang.String VIEWID_PARAM
          Parameter name for the view id.
 
Method Summary
static java.lang.String decodeViewId(FacesContext context)
          Decodes the view id of the current request.
static java.lang.String encodeViewId(FacesContext context)
          Encodes the view id of the current UIViewRoot.
static java.lang.String getDefaultSuffix(FacesContext context)
          Returns the value to use for the default extension if the webapp is using url extension mapping.
static boolean isPostback(FacesContext context)
          Try to guess if this is a postback request.
static boolean isValueReference(java.lang.String value)
          Checks whether the string value is a value binding compatible string or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VIEWID_PARAM

public static final java.lang.String VIEWID_PARAM
Parameter name for the view id. The view id is mainly used as hidden field to handle the Restore View phase of a submitted form request.

See Also:
Constant Field Values

TRANSIENT_PARAM

public static final java.lang.String TRANSIENT_PARAM
Parameter name for the transient flag. The transient flag is mainly used as hidden field to handle the Restore View phase of a post-submitted form request without any state.

See Also:
Constant Field Values
Method Detail

isPostback

public static boolean isPostback(FacesContext context)
Try to guess if this is a postback request. We use a simple heuristic: for HttpServletRequests, "POST" and "PUT" are postbacks. For anything that isn't an HttpServletRequest, just guess that if there's a request parameter, it's probably a postback.

Parameters:
context - FacesContext that holds request information
Returns:
true if it's a postback request false otherwise.

getDefaultSuffix

public static java.lang.String getDefaultSuffix(FacesContext context)
Returns the value to use for the default extension if the webapp is using url extension mapping.

Parameters:
context - FacesContext that holds request information
Returns:
The default suffix

encodeViewId

public static java.lang.String encodeViewId(FacesContext context)
Encodes the view id of the current UIViewRoot.

Parameters:
context - FacesContext that holds request information
Returns:
The encoded view id

decodeViewId

public static java.lang.String decodeViewId(FacesContext context)
Decodes the view id of the current request.

Parameters:
context - FacesContext that holds request information
Returns:
The decoded view id

isValueReference

public static boolean isValueReference(java.lang.String value)
Checks whether the string value is a value binding compatible string or not.

Parameters:
value - the string to check
Returns:
true if value is a value binding compatible string else false

JSF-Spring

Copyright © 2006 mindmatters GmbH & Co. KG