List of usage examples for org.apache.wicket.markup.html SecurePackageResourceGuard SecurePackageResourceGuard
public SecurePackageResourceGuard()
From source file:au.org.theark.web.application.ArkWebApplication.java
License:Open Source License
public void init() { log.info("In Constructor of ArkApplication"); super.init(); getComponentInstantiationListeners().add(new SpringComponentInjector(this, context(), true)); SecurePackageResourceGuard guard = new SecurePackageResourceGuard(); guard.addPattern("+*.js"); guard.addPattern("+*.jar"); getResourceSettings().setPackageResourceGuard(guard); }
From source file:org.obiba.onyx.webapp.OnyxApplication.java
License:Open Source License
protected void init() { log.info("Onyx Web Application [{}] is starting", getServletContext().getContextPath()); super.init(); createApplicationContext();/* w w w . java 2 s. c o m*/ super.addComponentInstantiationListener(new SpringComponentInjector(this, applicationContext, true)); forEachListeners(new IListenerCallback() { public void handleListener(String beanName, WebApplicationStartupListener listener) { listener.startup(OnyxApplication.this); } public boolean terminateOnException() { return true; } }); // nice urls mount("main", PackageName.forClass(HomePage.class)); mount("participants", PackageName.forClass(ParticipantSearchPage.class)); mount("workstation", PackageName.forClass(WorkstationPage.class)); mount("stage", PackageName.forClass(StagePage.class)); mount(new QueryStringUrlCodingStrategy("/ws/purge", PurgeWebService.class)); mount(new QueryStringUrlCodingStrategy("/ws/export", ExportWebService.class)); // mount("administration", PackageName.forClass(AdministrationPage.class)); getSecuritySettings().setAuthorizationStrategy(new RoleAuthorizationStrategy(new UserRolesAuthorizer())); getSecuritySettings().setUnauthorizedComponentInstantiationListener(this); getApplicationSettings().setPageExpiredErrorPage(HomePage.class); getApplicationSettings().setInternalErrorPage(InternalErrorPage.class); SecurePackageResourceGuard guard = new SecurePackageResourceGuard(); guard.addPattern("+*.*"); getResourceSettings().setPackageResourceGuard(guard); // Set default timeout getRequestCycleSettings().setTimeout(Duration.ONE_HOUR); log.info("Onyx Web Application [{}] v{} has started", getServletContext().getContextPath(), this.getVersion()); }