source: vlo/branches/vlo-3.0/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/VloWicketApplication.java @ 4515

Last change on this file since 4515 was 4515, checked in by twagoo, 10 years ago

updated package structure (added vlo.wicket.*) and removed two obsolete pojo classes

File size: 1.6 KB
Line 
1package eu.clarin.cmdi.vlo;
2
3import eu.clarin.cmdi.vlo.wicket.pages.FacetedSearchPage;
4import org.apache.wicket.markup.html.WebPage;
5import org.apache.wicket.protocol.http.WebApplication;
6import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
7import org.springframework.beans.BeansException;
8import org.springframework.context.ApplicationContext;
9import org.springframework.context.ApplicationContextAware;
10
11/**
12 * Application object for your web application. If you want to run this
13 * application without deploying, run the Start class.
14 *
15 * @see eu.clarin.cmdi.Start#main(String[])
16 */
17public class VloWicketApplication extends WebApplication implements ApplicationContextAware {
18
19    private ApplicationContext applicationContext;
20
21    /**
22     * @return the home page of this application
23     * @see org.apache.wicket.Application#getHomePage()
24     */
25    @Override
26    public Class<? extends WebPage> getHomePage() {
27        return FacetedSearchPage.class;
28    }
29
30    /**
31     * @see org.apache.wicket.Application#init()
32     */
33    @Override
34    public void init() {
35        super.init();
36        // this listener will inject any spring beans that need to be autowired
37        getComponentInstantiationListeners().add(new SpringComponentInjector(this, applicationContext));
38    }
39
40    /**
41     * Method needed for dynamic injection of application context (as happens in
42     * unit tests)
43     *
44     * @param applicationContext
45     * @throws BeansException
46     */
47    @Override
48    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
49        this.applicationContext = applicationContext;
50    }
51}
Note: See TracBrowser for help on using the repository browser.