Refine search
private void configureAccessDeniedPage(ApplicationSettings applicationSettings, List<WicketClassCandidate<Page>> accessDeniedPageCandidates, Builder builder) { Class<Page> candidate = null; if(accessDeniedPageCandidates.size() > 0) { if(accessDeniedPageCandidates.size() == 1){ WicketClassCandidate<Page> accessDeniedPage = accessDeniedPageCandidates.get(0); candidate = accessDeniedPage.getCandidate(); applicationSettings.setAccessDeniedPage(accessDeniedPage.getCandidate()); } else { throwExceptionOnMultipleAnnotations(WicketAccessDeniedPage.class, accessDeniedPageCandidates); } } builder.withDetail("accessDeniedPage", candidate); }
/** * @see org.apache.wicket.jmx.ApplicationSettingsMBean#setDefaultMaximumUploadSize(java.lang.String) */ @Override public void setDefaultMaximumUploadSize(final String defaultUploadSize) { application.getApplicationSettings().setDefaultMaximumUploadSize( Bytes.valueOf(defaultUploadSize)); } }
private static ClassLoader resolveClassLoader() { ClassLoader classLoader = null; if (org.apache.wicket.Application.exists()) { classLoader = org.apache.wicket.Application.get().getApplicationSettings() .getClassResolver().getClassLoader(); } if (classLoader == null) { classLoader = Thread.currentThread().getContextClassLoader(); } return classLoader; }
try clazz = Application.get() .getApplicationSettings() .getClassResolver() .resolveClass(className);
return createPageRequestHandler(new PageProvider(Application.get() .getApplicationSettings() .getPageExpiredErrorPage())); return createPageRequestHandler(new PageProvider(Application.get() .getApplicationSettings() .getAccessDeniedPage()));
getApplicationSettings().setDefaultMaximumUploadSize(Bytes.megabytes(100)); getMarkupSettings().setDefaultMarkupEncoding("utf-8"); final MyAuthorizationStrategy authStrategy = new MyAuthorizationStrategy(); getApplicationSettings().setPageExpiredErrorPage(PageExpiredPage.class); // Don't show expired page. getApplicationSettings().setInternalErrorPage(ErrorPage.class); getRequestCycleSettings().setTimeout(Duration.minutes(Const.WICKET_REQUEST_TIMEOUT_MINUTES)); if (isStripWicketTags() == true) { log.info("Strip Wicket tags also in development mode at default (see context.xml)."); Application.get().getMarkupSettings().setStripWicketTags(true);
/** * Delegates authentication. Subclasses should first try there custom authentication scheme * before letting super handle the call. Subclasses should either return a boolean value (see * {@link #handleBasicAuthentication(WebRequest, WebResponse, String, String)} ) if processing * should continue or throw an exception. * * @param request * @param response * @param scheme * the authentication scheme like "Basic" or "Digest" * @param param * the parameters after the scheme from the header * @throws LoginException * if the user could not be logged in. * @throws RestartResponseAtInterceptPageException * to an {@link AccessDeniedPage} if the scheme is not supported */ protected void handleAuthentication(WebRequest request, WebResponse response, String scheme, String param) throws LoginException { if (!handleBasicAuthentication(request, response, scheme, param)) return; log.error("Unsupported Http authentication type: " + scheme); throw new RestartResponseAtInterceptPageException(Application.get() .getApplicationSettings() .getAccessDeniedPage()); }
classResolver.add(new PluginClassResolver(plugin)); application.getApplicationSettings().setClassResolver(classResolver); application.setMetaData(PLUGIN_MANAGER_KEY, pluginManager); application.getComponentInstantiationListeners().add(new PluginComponentInjector(application));
/** * @see org.apache.wicket.jmx.ApplicationSettingsMBean#getClassResolver() */ @Override public String getClassResolver() { return Stringz.className(application.getApplicationSettings().getClassResolver()); }
@Override public void init() { super.init(); getRequestCycleSettings().setTimeout(Duration.minutes(5)); getRequestCycleListeners().add(new SingularServerContextListener()); Locale.setDefault(new Locale("pt", "BR"));//NOSONAR getApplicationSettings().setAccessDeniedPage(Error403Page.class); getApplicationSettings().setPageExpiredErrorPage(Page410.class); // Don't forget to check your Application server for this getApplicationSettings().setDefaultMaximumUploadSize(Bytes.megabytes(10)); getMarkupSettings().setStripWicketTags(true); getMarkupSettings().setStripComments(true); getMarkupSettings().setDefaultMarkupEncoding(StandardCharsets.UTF_8.name()); getComponentOnConfigureListeners().add(component -> { boolean outputId = !component.getRenderBodyOnly(); component.setOutputMarkupId(outputId).setOutputMarkupPlaceholderTag(outputId); }); getComponentInstantiationListeners().add(new SpringComponentInjector(this, getApplicationContext(), true)); new SingularAnnotatedMountScanner().mountPages(this); if (RuntimeConfigurationType.DEVELOPMENT == getConfigurationType()) { getDebugSettings().setComponentPathAttributeName("wicketdebug"); WicketSerializationDebugUtil.configurePageSerializationDebug(this, this.getClass()); } }
@Override public String getDefaultMaximumUploadSize() { return application.getApplicationSettings().getDefaultMaximumUploadSize().toString(); }
protected void internalInit() super.internalInit(); getApplicationSettings().setPageExpiredErrorPage(PageExpiredErrorPage.class); getApplicationSettings().setInternalErrorPage(InternalErrorPage.class); getApplicationSettings().setAccessDeniedPage(AccessDeniedPage.class);
/** * @see org.apache.wicket.jmx.ApplicationSettingsMBean#getAccessDeniedPage() */ @Override public String getAccessDeniedPage() { return Classes.name(application.getApplicationSettings().getAccessDeniedPage()); }
@Override public void init() { super.init(); getMarkupSettings().setStripWicketTags(true); getMarkupSettings().setStripComments(true); getApplicationSettings().setAccessDeniedPage(Page403.class); getApplicationSettings().setPageExpiredErrorPage(Page410.class); getMarkupSettings().setDefaultMarkupEncoding(StandardCharsets.UTF_8.name()); setHeaderResponseDecorator(r -> new JavaScriptFilteredIntoFooterHeaderResponse(r, SingularTemplate.JAVASCRIPT_CONTAINER)); getComponentInstantiationListeners().add(new SpringComponentInjector(this)); new AnnotatedMountScanner().scanPackage("org.opensingular.studio").mount(this); List<IStringResourceLoader> stringResourceLoaders = getResourceSettings().getStringResourceLoaders(); stringResourceLoaders.add(0, new ClassStringResourceLoader(appConfig.getClass())); getComponentOnConfigureListeners().add(component -> { boolean outputId = !component.getRenderBodyOnly(); component.setOutputMarkupId(outputId).setOutputMarkupPlaceholderTag(outputId); }); }
private void configureExpiredPage(ApplicationSettings applicationSettings, List<WicketClassCandidate<Page>> expiredPageCandidates, Builder builder) { Class<Page> candidate = null; if(expiredPageCandidates.size() > 0) { if(expiredPageCandidates.size() == 1){ WicketClassCandidate<Page> expiredPageCandidate = expiredPageCandidates.get(0); applicationSettings.setPageExpiredErrorPage(expiredPageCandidate.getCandidate()); candidate = expiredPageCandidate.getCandidate(); builder.withDetail("expiredPage", expiredPageCandidate.getCandidate().getName()); } else { throwExceptionOnMultipleAnnotations(WicketExpiredPage.class, expiredPageCandidates); } } builder.withDetail("expiredPage", candidate); }
private void configureInternalErrorPage(ApplicationSettings applicationSettings, List<WicketClassCandidate<Page>> internalErrorPageCandidates, Builder builder) { Class<Page> candidate = null; if(internalErrorPageCandidates.size() > 0) { if(internalErrorPageCandidates.size() == 1){ WicketClassCandidate<Page> internalErrorPage = internalErrorPageCandidates.get(0); candidate = internalErrorPage.getCandidate(); applicationSettings.setInternalErrorPage(internalErrorPage.getCandidate()); } else { throwExceptionOnMultipleAnnotations(WicketInternalErrorPage.class, internalErrorPageCandidates); } } builder.withDetail("internalErrorPage", candidate); }
private void handleInit(WebApplication application) { // application.initApplication(); delegatingClassResolver = new DelegatingClassResolver(bundleContext, applicationName); delegatingClassResolver.intialize(); delegatingComponentInstanciationListener = new DelegatingComponentInstanciationListener(bundleContext, applicationName); delegatingComponentInstanciationListener.intialize(); application.getFrameworkSettings().setSerializer(new PaxWicketSerializer(getApplicationName())); application.getComponentInstantiationListeners().add(new ComponentInstantiationListenerFacade( delegatingComponentInstanciationListener)); application.getApplicationSettings().setClassResolver(delegatingClassResolver); mounterTracker = new PageMounterTracker(bundleContext, application, getApplicationName()); mounterTracker.open(); filterDelegator.start(); }
try clazz = Application.get() .getApplicationSettings() .getClassResolver() .resolveClass(className);
return createPageRequestHandler(new PageProvider(Application.get() .getApplicationSettings() .getPageExpiredErrorPage())); return createPageRequestHandler(new PageProvider(Application.get() .getApplicationSettings() .getAccessDeniedPage()));
classResolver.add(new PluginClassResolver(plugin)); application.getApplicationSettings().setClassResolver(classResolver); application.setMetaData(PLUGIN_MANAGER_KEY, pluginManager); application.getComponentInstantiationListeners().add(new PluginComponentInjector(application));