source: vlo/branches/vlo-2.13-param/vlo_webapp/src/main/java/eu/clarin/cmdi/vlo/config/WebAppParam.java @ 2570

Last change on this file since 2570 was 2570, checked in by keeloo, 11 years ago

created branch for parameterized vlo

File size: 816 bytes
Line 
1
2package eu.clarin.cmdi.vlo.config;
3
4import javax.servlet.ServletContext;
5import org.apache.wicket.protocol.http.WebApplication;
6
7/**
8 *
9 * @author keeloo
10 */
11public class WebAppParam {
12   
13    static WebApplication webApp = null;
14   
15    static ServletContext servletContext = null; 
16
17    /**
18     *
19     * @param param
20     * @return
21     */
22    public static String getContextParam(String param) {
23        // throw new UnsupportedOperationException("Not yet implemented");
24
25        if (webApp == null) {
26            webApp = WebApplication.get();
27            servletContext = webApp.getServletContext();
28            if (servletContext == null) {
29                // handle the error
30            }
31        }
32
33        String value = servletContext.getInitParameter(param);
34       
35        return value;
36    }
37}
Note: See TracBrowser for help on using the repository browser.