Search in sources :

Example 16 with Session

use of org.apache.wicket.Session 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

Session (org.apache.wicket.Session)16 HttpSession (javax.servlet.http.HttpSession)4 Test (org.junit.Test)4 Locale (java.util.Locale)3 WebPage (org.apache.wicket.markup.html.WebPage)3 WebSession (org.apache.wicket.protocol.http.WebSession)3 Page (org.apache.wicket.Page)2 MockApplication (org.apache.wicket.mock.MockApplication)2 Request (org.apache.wicket.request.Request)2 Response (org.apache.wicket.request.Response)2 RequestCycle (org.apache.wicket.request.cycle.RequestCycle)2 Authentication (org.springframework.security.core.Authentication)2 PrismObject (com.evolveum.midpoint.prism.PrismObject)1 SecurityContextAwareCallable (com.evolveum.midpoint.web.component.SecurityContextAwareCallable)1 CallableResult (com.evolveum.midpoint.web.component.util.CallableResult)1 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)1 CaseWorkItemsPanel (com.evolveum.midpoint.web.page.admin.cases.CaseWorkItemsPanel)1 AsyncDashboardPanel (com.evolveum.midpoint.web.page.admin.home.component.AsyncDashboardPanel)1 AccountCallableResult (com.evolveum.midpoint.web.page.admin.home.dto.AccountCallableResult)1 CasesTablePanel (com.evolveum.midpoint.web.page.admin.server.CasesTablePanel)1