Class ClientConfig
- java.lang.Object
- 
- org.apache.myfaces.lifecycle.clientwindow.ClientConfig
 
- 
- All Implemented Interfaces:
- Serializable
 
 public class ClientConfig extends Object implements Serializable Contains information about whether the user has JavaScript enabled on his client, etc. It also contains the windowhandler html which gets sent to the browser to detect the current windowId. This allows the 'customisation' of this html file to e.g. adopt the background colour to avoid screen flickering. Please note that all subclasses of ClientConfig should also be @SessionScoped as well!- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringCOOKIE_NAME_NOSCRIPT_ENABLEDWe will set a cookie with this very name if a noscript link got clicked by the userprotected StringwindowHandlerHtml
 - 
Constructor SummaryConstructors Constructor Description ClientConfig()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetUserAgent(FacesContext facesContext)This information will get stored as it cannot change during the session anyway.booleanisClientSideWindowHandlerRequest(FacesContext facesContext)Users can overload this method to define in which scenarios a request should result in an 'intercepted' page with proper windowId detection.booleanisJavaScriptEnabled()Defaults totrue.voidsetJavaScriptEnabled(boolean javaScriptEnabled)Set it tofalseif you don't like to use the JavaScript based client side windowhandler.
 
- 
- 
- 
Field Detail- 
COOKIE_NAME_NOSCRIPT_ENABLEDpublic static final String COOKIE_NAME_NOSCRIPT_ENABLED We will set a cookie with this very name if a noscript link got clicked by the user- See Also:
- Constant Field Values
 
 - 
windowHandlerHtmlprotected String windowHandlerHtml 
 
- 
 - 
Method Detail- 
isJavaScriptEnabledpublic boolean isJavaScriptEnabled() Defaults totrue.- Returns:
- if the user has JavaScript enabled
 
 - 
setJavaScriptEnabledpublic void setJavaScriptEnabled(boolean javaScriptEnabled) Set it tofalseif you don't like to use the JavaScript based client side windowhandler. In this case the request will be returned directly.- Parameters:
- javaScriptEnabled-
 
 - 
getUserAgentpublic String getUserAgent(FacesContext facesContext) This information will get stored as it cannot change during the session anyway.- Returns:
- the UserAgent of the request.
 
 - 
isClientSideWindowHandlerRequestpublic boolean isClientSideWindowHandlerRequest(FacesContext facesContext) Users can overload this method to define in which scenarios a request should result in an 'intercepted' page with proper windowId detection. By default the following User-Agents will be served directly:- .*bot.*
- .*Bot.*
- .*Slurp.*
- .*Crawler.*
 - Returns:
- trueif the Request should get 'intercepted' and the intermediate windowhandler.html page should get rendered first. By returning- falsethe requested page will get rendered intermediately.
- See Also:
- for determining the UserAgent
 
 
- 
 
-