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);
}
Aggregations