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

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

Introduction

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

Prototype

AjaxServerAndClientTimeFilter

Source Link

Usage

From source file:dk.teachus.frontend.TeachUsApplication.java

License:Apache License

@Override
protected void init() {
    if (getServletContext().getInitParameter("doDynamicDataImport") != null) {
        getDynamicDataImport().doImport();
    }//from ww  w .  j  av a  2s. c o  m

    // Settings
    CompoundAuthorizationStrategy authorizationStrategy = new CompoundAuthorizationStrategy();
    authorizationStrategy.add(new TeachUsCookieAuthentication());
    authorizationStrategy.add(new TeachUsAuthentication());
    getSecuritySettings().setAuthorizationStrategy(authorizationStrategy);
    getApplicationSettings().setPageExpiredErrorPage(PageExpiredPage.class);
    getApplicationSettings().setInternalErrorPage(InternalErrorPage.class);
    getExceptionSettings().setUnexpectedExceptionDisplay(IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);
    getMarkupSettings().setStripWicketTags(true);

    if (getConfigurationType() == RuntimeConfigurationType.DEVELOPMENT) {
        getRequestCycleSettings().addResponseFilter(new AjaxServerAndClientTimeFilter());
    }

    loadConfiguration();

    mountPages();

    mountResources();
}

From source file:fiftyfive.wicket.FoundationApplication.java

License:Apache License

/**
 * Disables ajaxDebugMode (the popup/* w  w w  .  j ava  2  s  .c om*/
 * panel in the browser that shows ajax request and response details).
 * It is disabled because it is a memory hog that can bog down the
 * browser. Finally, enables emitting HTML comments that show which Wicket
 * class created each section of HTML.
 */
protected void initDebugInformation() {
    getRequestCycleSettings().addResponseFilter(new AjaxServerAndClientTimeFilter());
    getDebugSettings().setOutputMarkupContainerClassName(true);
    // Turn this off explicity because it causes performance problems
    getDebugSettings().setAjaxDebugModeEnabled(false);
}

From source file:ro.nextreports.server.web.NextServerApplication.java

License:Apache License

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

    // log system info
    logSystemInfo();/*ww  w. j  a  v a 2s  .c  o m*/

    // spring
    addSpringInjection();

    // markup settings
    getMarkupSettings().setStripWicketTags(true);
    getMarkupSettings().setDefaultMarkupEncoding("UTF-8");

    // application settings
    if (CasUtil.isCasUsed()) {
        getApplicationSettings().setPageExpiredErrorPage(CasLoginPage.class);
        //         getApplicationSettings().setInternalErrorPage(CasLoginErrorPage.class);
        getApplicationSettings().setAccessDeniedPage(CasLoginPage.class);
    } else {
        getApplicationSettings().setPageExpiredErrorPage(LoginPage.class);
        //         getApplicationSettings().setInternalErrorPage(LoginErrorPage.class);
        getApplicationSettings().setAccessDeniedPage(LoginPage.class);
    }

    // show internal error page rather than default developer page 
    //      getExceptionSettings().setUnexpectedExceptionDisplay(IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);       

    // exception settings
    getResourceSettings().setThrowExceptionOnMissingResource(false);

    // security settings
    addSecurityAuthorization();

    // request cycle settings
    //      getRequestCycleSettings().addResponseFilter(new ServerAndClientTimeFilter());
    getRequestCycleSettings().addResponseFilter(new AjaxServerAndClientTimeFilter());

    // debug
    //      getDebugSettings().setAjaxDebugModeEnabled(false);
    getDebugSettings().setDevelopmentUtilitiesEnabled(true);

    // activate some options only in "DEVELOPMENT" mode
    if (usesDevelopmentConfig()) {
        // enable request logger
        getRequestLoggerSettings().setRequestLoggerEnabled(true);
        getRequestLoggerSettings().setRequestsWindowSize(3000);

        // locate where wicket markup comes from your browser's source view
        getDebugSettings().setOutputMarkupContainerClassName(true);
    }

    // mount
    //      new AnnotatedMountScanner().scanPackage(NextServerApplication.class.getPackage().getName()).mount(this);

    mount(new NoVersionMountMapper("/home", HomePage.class));

    if (CasUtil.isCasUsed()) {
        //mountPage("/login", CasLoginPage.class);
        mount(new NoVersionMountMapper("/login", CasLoginPage.class));
        // this matches the value set in securityCas.xml
        //mountPage("/cas/error", CasLoginErrorPage.class); 
        mount(new NoVersionMountMapper("/cas/error", CasLoginErrorPage.class));
    } else {
        //mountPage("/login", LoginPage.class);
        mount(new NoVersionMountMapper("/login", LoginPage.class));
    }
    mountPage("/debug", DevUtilsPage.class);
    mountPage("/sysinfo", SystemInfoPage.class);
    mountPage("/syslog", SystemLogPage.class);
    //      mountPage("/addFolders", AddFoldersPage.class); // for development
    //      mountPage("/pivot", PivotPage.class); // for development
    mountPage("/forgot", ForgotPasswordPage.class);
    mountPage("/reset", ResetPasswordPage.class);
    mountPage("/dashboards", DashboardsPage.class);
    mountPage("/reports", ReportsPage.class);

    // need to have a static url to view logo in maintenance page
    mountResource("/../images/logo.png", new LogoResourceReference());

    // load all jobs from repository to scheduler
    addJobsInScheduler();

    StorageService storageService = (StorageService) getSpringBean("storageService");
    if (storageService.getSettings() != null) {
        if (storageService.getSettings().getSynchronizer().isRunOnStartup()) {
            runUserSynchronizerJob();
        }

        IFrameSettings iframeSettings = storageService.getSettings().getIframe();
        if ((iframeSettings != null) && iframeSettings.isEnable()) {
            mount(new NoVersionMountMapper("/widget", WidgetWebPage.class));
            mount(new NoVersionMountMapper("/dashboard", DashboardWebPage.class));
        }

        // set the current color theme at startup
        ThemesManager.getInstance().setTheme(storageService.getSettings().getColorTheme());
    }

    getRequestCycleListeners().add(new ExceptionRequestCycleListener());
    getRequestCycleListeners().add(new LoggingRequestCycleListener());
    getRequestCycleListeners().add(new MaintenanceRequestCycleListener());

    logSettings(storageService.getSettings());

    LOG.info("NextReports Server " + ReleaseInfo.getVersion() + " started.");
}