Example usage for org.apache.wicket.response.filter ServerAndClientTimeFilter ServerAndClientTimeFilter

List of usage examples for org.apache.wicket.response.filter ServerAndClientTimeFilter ServerAndClientTimeFilter

Introduction

In this page you can find the example usage for org.apache.wicket.response.filter ServerAndClientTimeFilter ServerAndClientTimeFilter.

Prototype

ServerAndClientTimeFilter

Source Link

Usage

From source file:org.tdmx.console.AdminApplication.java

License:Open Source License

@Override
protected void init() {
    super.init();

    // dev utilities
    getDebugSettings().setDevelopmentUtilitiesEnabled(false);
    getDebugSettings().setAjaxDebugModeEnabled(false);
    getRequestCycleSettings().addResponseFilter(new ServerAndClientTimeFilter());

    // wicket bootstrap
    configureBootstrap();/*ww  w.  j a  v a  2 s  . c  o m*/

    // javascripts to the bottom
    setHeaderResponseDecorator(new RenderJavaScriptToFooterHeaderResponseDecorator());

    // Setting authorization strategy
    SimplePageAuthorizationStrategy authorizationStrategy = new SimplePageAuthorizationStrategy(
            IProtectedPage.class, LoginPage.class) {
        @Override
        protected boolean isAuthorized() {
            return ((CustomSession) Session.get()).isLoggedIn();
        }
    };
    getSecuritySettings().setAuthorizationStrategy(authorizationStrategy);

    // setting session expired error page
    IApplicationSettings applicationSettings = getApplicationSettings();
    applicationSettings.setPageExpiredErrorPage(LoginPage.class);

    // mount pages
    mountPage("login", LoginPage.class);
    mountPage("profile", ProfilePage.class);
    mount(new MountedMapperWithoutPageComponentInfo("domain", DomainPage.class));
    mountPage("domain/details", DomainDetailsPage.class);

    getMarkupSettings().setStripWicketTags(true);

}