Class ClientConfig
java.lang.Object
org.apache.myfaces.lifecycle.clientwindow.ClientConfig
- All Implemented Interfaces:
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:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetUserAgent
(FacesContext facesContext) This information will get stored as it cannot change during the session anyway.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.boolean
Defaults totrue
.void
setJavaScriptEnabled
(boolean javaScriptEnabled) Set it tofalse
if you don't like to use the JavaScript based client side windowhandler.
-
Field Details
-
COOKIE_NAME_NOSCRIPT_ENABLED
We will set a cookie with this very name if a noscript link got clicked by the user- See Also:
-
windowHandlerHtml
-
-
Constructor Details
-
ClientConfig
public ClientConfig()
-
-
Method Details
-
isJavaScriptEnabled
public boolean isJavaScriptEnabled()Defaults totrue
.- Returns:
- if the user has JavaScript enabled
-
setJavaScriptEnabled
public void setJavaScriptEnabled(boolean javaScriptEnabled) Set it tofalse
if you don't like to use the JavaScript based client side windowhandler. In this case the request will be returned directly.- Parameters:
javaScriptEnabled
-
-
getUserAgent
This information will get stored as it cannot change during the session anyway.- Returns:
- the UserAgent of the request.
-
isClientSideWindowHandlerRequest
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:
true
if the Request should get 'intercepted' and the intermediate windowhandler.html page should get rendered first. By returningfalse
the requested page will get rendered intermediately.- See Also:
-