Search in sources :

Example 6 with ClassPathResourceFinder

use of org.apache.wicket.core.util.resource.ClassPathResourceFinder in project wicket by apache.

the class Application method internalInit.

/**
 * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT OVERRIDE OR CALL.
 *
 * Internal initialization.
 */
protected void internalInit() {
    settingsAccessible = true;
    PageSettings pageSettings = getPageSettings();
    // Install default component resolvers
    pageSettings.addComponentResolver(new HtmlHeaderResolver());
    pageSettings.addComponentResolver(new WicketLinkTagHandler());
    pageSettings.addComponentResolver(new WicketMessageResolver());
    pageSettings.addComponentResolver(new RelativePathPrefixHandler());
    pageSettings.addComponentResolver(new EnclosureHandler());
    pageSettings.addComponentResolver(new InlineEnclosureHandler());
    pageSettings.addComponentResolver(new WicketMessageTagHandler());
    pageSettings.addComponentResolver(new WicketContainerResolver());
    getResourceSettings().getResourceFinders().add(new ClassPathResourceFinder(""));
    // Install button image resource factory
    getResourceSettings().addResourceFactory("buttonFactory", new DefaultButtonImageResourceFactory());
    String applicationKey = getApplicationKey();
    applicationKeyToApplication.put(applicationKey, this);
    converterLocator = newConverterLocator();
    setPageManagerProvider(new DefaultPageManagerProvider(this));
    resourceReferenceRegistry = newResourceReferenceRegistry();
    sharedResources = newSharedResources(resourceReferenceRegistry);
    resourceBundles = newResourceBundles(resourceReferenceRegistry);
    // set up default request mapper
    setRootRequestMapper(new SystemMapper(this));
    pageFactory = newPageFactory();
    requestCycleProvider = (context) -> new RequestCycle(context);
    exceptionMapperProvider = () -> new DefaultExceptionMapper();
    // add a request cycle listener that logs each request for the requestlogger.
    getRequestCycleListeners().add(new RequestLoggerRequestCycleListener());
}
Also used : RelativePathPrefixHandler(org.apache.wicket.markup.parser.filter.RelativePathPrefixHandler) PageSettings(org.apache.wicket.settings.PageSettings) RequestCycle(org.apache.wicket.request.cycle.RequestCycle) HtmlHeaderResolver(org.apache.wicket.markup.resolver.HtmlHeaderResolver) WicketMessageTagHandler(org.apache.wicket.markup.parser.filter.WicketMessageTagHandler) ClassPathResourceFinder(org.apache.wicket.core.util.resource.ClassPathResourceFinder) DefaultButtonImageResourceFactory(org.apache.wicket.markup.html.image.resource.DefaultButtonImageResourceFactory) WicketMessageResolver(org.apache.wicket.markup.resolver.WicketMessageResolver) InlineEnclosureHandler(org.apache.wicket.markup.parser.filter.InlineEnclosureHandler) InlineEnclosureHandler(org.apache.wicket.markup.parser.filter.InlineEnclosureHandler) EnclosureHandler(org.apache.wicket.markup.parser.filter.EnclosureHandler) RequestLoggerRequestCycleListener(org.apache.wicket.protocol.http.RequestLoggerRequestCycleListener) WicketContainerResolver(org.apache.wicket.markup.resolver.WicketContainerResolver) WicketLinkTagHandler(org.apache.wicket.markup.parser.filter.WicketLinkTagHandler)

Aggregations

ClassPathResourceFinder (org.apache.wicket.core.util.resource.ClassPathResourceFinder)6 IResourceStreamLocator (org.apache.wicket.core.util.resource.locator.IResourceStreamLocator)4 ResourceStreamLocator (org.apache.wicket.core.util.resource.locator.ResourceStreamLocator)4 Test (org.junit.Test)4 Locale (java.util.Locale)3 CachingResourceStreamLocator (org.apache.wicket.core.util.resource.locator.caching.CachingResourceStreamLocator)3 IResourceStream (org.apache.wicket.util.resource.IResourceStream)3 AjaxRequestHandler (org.apache.wicket.ajax.AjaxRequestHandler)1 WebApplicationPath (org.apache.wicket.core.util.file.WebApplicationPath)1 AutoLabelResolver (org.apache.wicket.markup.html.form.AutoLabelResolver)1 AutoLabelTextResolver (org.apache.wicket.markup.html.form.AutoLabelTextResolver)1 DefaultButtonImageResourceFactory (org.apache.wicket.markup.html.image.resource.DefaultButtonImageResourceFactory)1 EnclosureHandler (org.apache.wicket.markup.parser.filter.EnclosureHandler)1 InlineEnclosureHandler (org.apache.wicket.markup.parser.filter.InlineEnclosureHandler)1 RelativePathPrefixHandler (org.apache.wicket.markup.parser.filter.RelativePathPrefixHandler)1 WicketLinkTagHandler (org.apache.wicket.markup.parser.filter.WicketLinkTagHandler)1 WicketMessageTagHandler (org.apache.wicket.markup.parser.filter.WicketMessageTagHandler)1 AutoLinkResolver (org.apache.wicket.markup.resolver.AutoLinkResolver)1 HtmlHeaderResolver (org.apache.wicket.markup.resolver.HtmlHeaderResolver)1 WicketContainerResolver (org.apache.wicket.markup.resolver.WicketContainerResolver)1