Search in sources :

Example 1 with AnnotatedMountScanner

use of org.wicketstuff.annotation.scan.AnnotatedMountScanner in project ocvn by devgateway.

the class FormsWebApplication method init.

/**
     * <ul>
     * <li>making the wicket components injectable by activating the
     * SpringComponentInjector</li>
     * <li>mounting the test page</li>
     * <li>logging spring service method output to showcase working integration
     * </li>
     * </ul>
     */
@Override
protected void init() {
    super.init();
    // add allowed woff2 extension
    IPackageResourceGuard packageResourceGuard = getResourceSettings().getPackageResourceGuard();
    if (packageResourceGuard instanceof SecurePackageResourceGuard) {
        SecurePackageResourceGuard guard = (SecurePackageResourceGuard) packageResourceGuard;
        guard.addPattern("+*.woff2");
        guard.addPattern("+*.xlsx");
    }
    //this ensures that spring DI works for wicket components and pages
    //see @SpringBean annotation
    getComponentInstantiationListeners().add(new SpringComponentInjector(this, applicationContext));
    //this will scan packages for pages with @MountPath annotations and automatically create URLs for them
    new AnnotatedMountScanner().scanPackage(BASE_PACKAGE_FOR_PAGES).mount(this);
    getApplicationSettings().setUploadProgressUpdatesEnabled(true);
    getApplicationSettings().setAccessDeniedPage(Homepage.class);
    // deactivate ajax debug mode
    // getDebugSettings().setAjaxDebugModeEnabled(false);
    configureBootstrap();
    configureSummernote();
    optimizeForWebPerformance();
    // http://.../wicket/internal/debug/diskDataStore
    if (usesDevelopmentConfig()) {
        DebugDiskDataStore.register(this);
    }
    SessionFinderHolder.setSessionFinder(sessionFinderService);
}
Also used : IPackageResourceGuard(org.apache.wicket.markup.html.IPackageResourceGuard) SecurePackageResourceGuard(org.apache.wicket.markup.html.SecurePackageResourceGuard) AnnotatedMountScanner(org.wicketstuff.annotation.scan.AnnotatedMountScanner) SpringComponentInjector(org.apache.wicket.spring.injection.annot.SpringComponentInjector)

Aggregations

IPackageResourceGuard (org.apache.wicket.markup.html.IPackageResourceGuard)1 SecurePackageResourceGuard (org.apache.wicket.markup.html.SecurePackageResourceGuard)1 SpringComponentInjector (org.apache.wicket.spring.injection.annot.SpringComponentInjector)1 AnnotatedMountScanner (org.wicketstuff.annotation.scan.AnnotatedMountScanner)1