/** * Returns location of context config that will be used to create a {@link WebApplication} * -specific application context. * * @param filter * @return location of context config */ protected final String getContextConfigLocation(final WicketFilter filter) { return filter.getFilterConfig().getInitParameter("contextConfigLocation"); }
/** * Gets the servlet context for this application. Use this to get references to absolute paths, * global web.xml parameters (<context-param>), etc. * * @return The servlet context for this application */ public ServletContext getServletContext() { if (wicketFilter != null) { return wicketFilter.getFilterConfig().getServletContext(); } throw new IllegalStateException("servletContext is not set yet. Any code in your" + " Application object that uses the wicket filter instance should be put" + " in the init() method instead of your constructor"); }
public WebApplication createApplication(WicketFilter filter) { ServletContext servletContext = filter.getFilterConfig().getServletContext(); BundleContext bundleContext = (BundleContext)servletContext.getAttribute("osgi-bundlecontext"); String appName = filter.getFilterConfig().getInitParameter(APPLICATION_NAME_KEY); Map<String, String> props = new LinkedHashMap<String, String>(1); props.put(APPLICATION_NAME_KEY, appName); WebApplication webApplication = OsgiServiceLookup.getOsgiService(bundleContext, WebApplication.class, props); return webApplication; }
/** * Gets the servlet context for this application. Use this to get references to absolute paths, * global web.xml parameters (<context-param>), etc. * * @return The servlet context for this application */ public ServletContext getServletContext() { if (wicketFilter != null) { return wicketFilter.getFilterConfig().getServletContext(); } throw new IllegalStateException("servletContext is not set yet. Any code in your" + " Application object that uses the wicket filter instance should be put" + " in the init() method instead of your constructor"); }
/** * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL IT. * * @param wicketFilter * The wicket filter instance for this application */ public final void setWicketFilter(final WicketFilter wicketFilter) { Args.notNull(wicketFilter, "wicketFilter"); this.wicketFilter = wicketFilter; servletContext = wicketFilter.getFilterConfig().getServletContext(); }
/** * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL IT. * * @param wicketFilter * The wicket filter instance for this application */ public final void setWicketFilter(final WicketFilter wicketFilter) { Args.notNull(wicketFilter, "wicketFilter"); this.wicketFilter = wicketFilter; servletContext = wicketFilter.getFilterConfig().getServletContext(); }
/** * @see IWebApplicationFactory#createApplication(WicketFilter) */ public WebApplication createApplication(WicketFilter filter) { ServletContext sc = filter.getFilterConfig().getServletContext(); ApplicationContext ac = WebApplicationContextUtils.getRequiredWebApplicationContext(sc); String beanName = filter.getFilterConfig().getInitParameter("applicationBean"); return createApplication(ac, beanName); }
/** * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL IT. * * @param wicketFilter * The wicket filter instance for this application */ public final void setWicketFilter(final WicketFilter wicketFilter) { this.wicketFilter = wicketFilter; applicationKey = wicketFilter.getFilterConfig().getFilterName(); }
/** * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL IT. * * @param wicketFilter * The wicket filter instance for this application */ public final void setWicketFilter(final WicketFilter wicketFilter) { this.wicketFilter = wicketFilter; applicationKey = wicketFilter.getFilterConfig().getFilterName(); }
/** * @see IWebApplicationFactory#createApplication(WicketFilter) */ @Override public WebApplication createApplication(final WicketFilter filter) { ServletContext servletContext = filter.getFilterConfig().getServletContext(); WebApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext(servletContext); if (getContextConfigLocation(filter) != null) { applicationContext = createWebApplicationContext(applicationContext, filter); } String beanName = filter.getFilterConfig().getInitParameter("applicationBean"); return createApplication(applicationContext, beanName); }
@Override public WebApplication createApplication(WicketFilter filter) { final String applicationClassName = filter.getFilterConfig().getInitParameter( APP_CLASS_PARAM); if (applicationClassName == null) { throw new WicketRuntimeException( "servlet init param [" + APP_CLASS_PARAM + "] is missing. If you are trying to use your own implementation of IWebApplicationFactory and get this message then the servlet init param [" + WicketFilter.APP_FACT_PARAM + "] is missing"); } return createApplication(applicationClassName); }
public WebApplication createApplication(WicketFilter filter) { final String applicationClassName = filter.getFilterConfig().getInitParameter( APP_CLASS_PARAM); if (applicationClassName == null) { throw new WicketRuntimeException( "servlet init param [" + APP_CLASS_PARAM + "] is missing. If you are trying to use your own implementation of IWebApplicationFactory and get this message then the servlet init param [" + WicketFilter.APP_FACT_PARAM + "] is missing"); } return createApplication(applicationClassName); }
@Override public WebApplication createApplication(WicketFilter filter) { final String applicationClassName = filter.getFilterConfig().getInitParameter( APP_CLASS_PARAM); if (applicationClassName == null) { throw new WicketRuntimeException( "servlet init param [" + APP_CLASS_PARAM + "] is missing. If you are trying to use your own implementation of IWebApplicationFactory and get this message then the servlet init param [" + WicketFilter.APP_FACT_PARAM + "] is missing"); } return createApplication(applicationClassName); }
/** @see IWebApplicationFactory#createApplication(WicketFilter) */ public WebApplication createApplication(WicketFilter filter) { final String applicationClassName = filter.getFilterConfig().getInitParameter( APP_CLASS_PARAM); if (applicationClassName == null) { throw new WicketRuntimeException( "servlet init param [" + APP_CLASS_PARAM + "] is missing. If you are trying to use your own implementation of IWebApplicationFactory and get this message then the servlet init param [" + WicketFilter.APP_FACT_PARAM + "] is missing"); } return createApplication(applicationClassName); }
@Override public Object getObject() { parameters.put("id", componentMarkupId); parameters.put("filterName", WebApplication.get().getWicketFilter().getFilterConfig().getFilterName()); return parameters; } }
@Override public Object getObject() { parameters.put("id", componentMarkupId); parameters.put("filterName", WebApplication.get().getWicketFilter().getFilterConfig().getFilterName()); return parameters; } }
public void bind(Component component) { parameters.put("id", component.getMarkupId()); parameters.put("filterName", WebApplication.get().getWicketFilter().getFilterConfig().getFilterName()); }
/** * Add a X-Forwarded web filter factory * * @param config * If null, <code>WebApplication.get().getWicketFilter().getFilterConfig()</code> * will be called to retrieve the config. * @return this */ public final FilterFactoryManager addXForwardedRequestWrapperFactory(FilterConfig config) { if (config == null) { config = WebApplication.get().getWicketFilter().getFilterConfig(); } XForwardedRequestWrapperFactory factory = new XForwardedRequestWrapperFactory(); factory.init(config); return add(factory); }
/** * Add a X-Forwarded web filter factory * * @param config * If null, <code>WebApplication.get().getWicketFilter().getFilterConfig()</code> * will be called to retrieve the config. * @return this */ public final FilterFactoryManager addXForwardedRequestWrapperFactory(FilterConfig config) { if (config == null) { config = WebApplication.get().getWicketFilter().getFilterConfig(); } XForwardedRequestWrapperFactory factory = new XForwardedRequestWrapperFactory(); factory.init(config); return add(factory); }
/** * Add a Secure remote address web filter factory * * @param config * If null, <code>WebApplication.get().getWicketFilter().getFilterConfig()</code> * will be called to retrieve the config. * @return this */ public final FilterFactoryManager addSecuredRemoteAddressRequestWrapperFactory( FilterConfig config) { if (config == null) { config = WebApplication.get().getWicketFilter().getFilterConfig(); } SecuredRemoteAddressRequestWrapperFactory factory = new SecuredRemoteAddressRequestWrapperFactory(); factory.init(config); return add(factory); }