| | |
| | | */
|
| | | package com.gitblit.wicket;
|
| | |
|
| | | import java.util.HashMap;
|
| | | import java.util.Locale;
|
| | | import java.util.Map;
|
| | |
|
| | | import org.apache.wicket.Application;
|
| | | import org.apache.wicket.Page;
|
| | |
| | | public class GitBlitWebApp extends WebApplication {
|
| | |
|
| | | public final static Class<? extends BasePage> HOME_PAGE_CLASS = MyDashboardPage.class;
|
| | | |
| | | private final Map<String, CacheControl> cacheablePages = new HashMap<String, CacheControl>();
|
| | |
|
| | | @Override
|
| | | public void init() {
|
| | |
| | | parameters = new String[] {};
|
| | | }
|
| | | mount(new GitblitParamUrlCodingStrategy(location, clazz, parameters));
|
| | | |
| | | // map the mount point to the cache control definition |
| | | if (clazz.isAnnotationPresent(CacheControl.class)) {
|
| | | CacheControl cacheControl = clazz.getAnnotation(CacheControl.class);
|
| | | cacheablePages.put(location.substring(1), cacheControl);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | return HOME_PAGE_CLASS;
|
| | | }
|
| | |
|
| | | public boolean isCacheablePage(String mountPoint) {
|
| | | return cacheablePages.containsKey(mountPoint);
|
| | | }
|
| | |
|
| | | public CacheControl getCacheControl(String mountPoint) {
|
| | | return cacheablePages.get(mountPoint);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public final Session newSession(Request request, Response response) {
|
| | | GitBlitWebSession gitBlitWebSession = new GitBlitWebSession(request);
|