Search in sources :

Example 6 with ResourceUrl

use of org.apache.wicket.request.resource.caching.ResourceUrl in project wicket by apache.

the class CssUrlReplacerTest method newApplication.

@Override
protected WebApplication newApplication() {
    return new MockApplication() {

        @Override
        protected void init() {
            super.init();
            getResourceSettings().setCachingStrategy(new FilenameWithVersionResourceCachingStrategy("=VER=", new MessageDigestResourceVersion()) {

                @Override
                public void decorateUrl(ResourceUrl url, IStaticCacheableResource resource) {
                    url.setFileName(url.getFileName() + DECORATION_SUFFIX);
                }
            });
        }

        @Override
        public Session newSession(Request request, Response response) {
            Session newSession = super.newSession(request, response);
            newSession.setLocale(Locale.ROOT);
            return newSession;
        }
    };
}
Also used : FilenameWithVersionResourceCachingStrategy(org.apache.wicket.request.resource.caching.FilenameWithVersionResourceCachingStrategy) IStaticCacheableResource(org.apache.wicket.request.resource.caching.IStaticCacheableResource) Response(org.apache.wicket.request.Response) MockApplication(org.apache.wicket.mock.MockApplication) Request(org.apache.wicket.request.Request) MessageDigestResourceVersion(org.apache.wicket.request.resource.caching.version.MessageDigestResourceVersion) ResourceUrl(org.apache.wicket.request.resource.caching.ResourceUrl) Session(org.apache.wicket.Session)

Aggregations

ResourceUrl (org.apache.wicket.request.resource.caching.ResourceUrl)6 IStaticCacheableResource (org.apache.wicket.request.resource.caching.IStaticCacheableResource)4 PageParameters (org.apache.wicket.request.mapper.parameter.PageParameters)3 Url (org.apache.wicket.request.Url)2 ResourceReferenceRequestHandler (org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler)2 IResource (org.apache.wicket.request.resource.IResource)2 MetaInfStaticResourceReference (org.apache.wicket.request.resource.MetaInfStaticResourceReference)2 ResourceReference (org.apache.wicket.request.resource.ResourceReference)2 FilenameWithVersionResourceCachingStrategy (org.apache.wicket.request.resource.caching.FilenameWithVersionResourceCachingStrategy)2 StringTokenizer (java.util.StringTokenizer)1 Session (org.apache.wicket.Session)1 MockApplication (org.apache.wicket.mock.MockApplication)1 Request (org.apache.wicket.request.Request)1 Response (org.apache.wicket.request.Response)1 AbortWithHttpErrorCodeException (org.apache.wicket.request.http.flow.AbortWithHttpErrorCodeException)1 INamedParameters (org.apache.wicket.request.mapper.parameter.INamedParameters)1 ResourceReferenceRegistry (org.apache.wicket.request.resource.ResourceReferenceRegistry)1 IResourceCachingStrategy (org.apache.wicket.request.resource.caching.IResourceCachingStrategy)1 MessageDigestResourceVersion (org.apache.wicket.request.resource.caching.version.MessageDigestResourceVersion)1 StaticResourceVersion (org.apache.wicket.request.resource.caching.version.StaticResourceVersion)1