Search in sources :

Example 1 with RequestCycleSettings

use of org.apache.wicket.settings.RequestCycleSettings in project wicket by apache.

the class AjaxHelloBrowser method getClientProperties.

/**
 * A helper function that makes sure that gathering of extended browser info
 * is not enabled when reading the ClientInfo's properties
 *
 * @return the currently available client info
 */
private ClientProperties getClientProperties() {
    RequestCycleSettings requestCycleSettings = getApplication().getRequestCycleSettings();
    boolean gatherExtendedBrowserInfo = requestCycleSettings.getGatherExtendedBrowserInfo();
    ClientProperties properties = null;
    try {
        requestCycleSettings.setGatherExtendedBrowserInfo(false);
        WebClientInfo clientInfo = (WebClientInfo) getSession().getClientInfo();
        properties = clientInfo.getProperties();
    } finally {
        requestCycleSettings.setGatherExtendedBrowserInfo(gatherExtendedBrowserInfo);
    }
    return properties;
}
Also used : WebClientInfo(org.apache.wicket.protocol.http.request.WebClientInfo) ClientProperties(org.apache.wicket.protocol.http.ClientProperties) RequestCycleSettings(org.apache.wicket.settings.RequestCycleSettings)

Aggregations

ClientProperties (org.apache.wicket.protocol.http.ClientProperties)1 WebClientInfo (org.apache.wicket.protocol.http.request.WebClientInfo)1 RequestCycleSettings (org.apache.wicket.settings.RequestCycleSettings)1