/** * 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"); }
private synchronized void initWicketFilter() { if (wicketFilter != null) { return; } wicketFilter = new WicketFilter(); try { wicketFilter.init(new FilterConfig() { public String getFilterName() { return WICKET_FILTER_NAME; } public String getInitParameter(String name) { if ("applicationFactoryClassName".equals(name)) { return SpringWebApplicationFactory.class.getName(); } return null; } public Enumeration<String> getInitParameterNames() { Vector<String> paramNames = new Vector<String>(); paramNames.add("applicationFactoryClassName"); return paramNames.elements(); } public ServletContext getServletContext() { return WicketReader.this.servletContext; } }); } catch (ServletException e) { throw new SetupException("Can't initialize Wicket.", e); } }
@Override protected WicketFilter newWicketFilter() { WicketFilter filter = new WicketFilter(GeoServerExtensions.bean(GeoServerApplication.class)); filter.setFilterPath("/web"); return filter; } }
inPortletContext = filterPortletContext.setupFilter(getFilterConfig(), filterRequestContext, getFilterPath((HttpServletRequest)request)); httpServletRequest = filterRequestContext.getRequest(); httpServletResponse = filterRequestContext.getResponse(); String relativePath = getRelativePath(httpServletRequest); if (isWicketRequest(relativePath)) long lastModified = getLastModified(httpServletRequest); if (lastModified == -1) if (doGet(httpServletRequest, httpServletResponse) == false) maybeSetLastModified(httpServletResponse, lastModified); doGet(httpServletRequest, httpServletResponse);
initIgnorePaths(filterConfig); final ClassLoader newClassLoader = getClassLoader(); try applicationFactory = getApplicationFactory(); application = applicationFactory.createApplication(this); String configureFilterPath = getFilterPath(); configureFilterPath = getFilterPathFromConfig(filterConfig); configureFilterPath = getFilterPathFromWebXml(isServlet, filterConfig); configureFilterPath = getFilterPathFromAnnotation(isServlet); setFilterPath(configureFilterPath); if (getFilterPath() == null) destroy();
String homePageUri = contextPath + '/' + getFilterPath(); if (homePageUri.endsWith("/"))
final ClassLoader newClassLoader = getClassLoader(); try filterPath = getFilterPath(filterConfig.getFilterName(), is); IWebApplicationFactory factory = getApplicationFactory(); .booleanValue(); if (isPortletContextAvailable(filterConfig)) filterPortletContext = newWicketFilterPortletContext();
if (webApplication.getWicketFilter().getFilterPath() == null) webApplication.getWicketFilter().setFilterPath("");
/** * If you do have a need to subclass, you may subclass {@link #init(boolean, FilterConfig)} * * @see javax.servlet.Filter#init(javax.servlet.FilterConfig) */ @Override public final void init(final FilterConfig filterConfig) throws ServletException { init(false, filterConfig); }
final ClassLoader newClassLoader = getClassLoader(); String filterPath = getFilterPath(httpServletRequest); if (shouldIgnorePath(httpServletRequest)) String redirectURL = checkIfRedirectRequired(httpServletRequest); if (redirectURL == null) res = processRequestCycle(requestCycle, webResponse, httpServletRequest, httpServletResponse, chain);
/** * @return The wicket filter */ protected WicketFilter newWicketFilter() { return new WicketFilter(); }
/** * Servlet cleanup. */ @Override public void destroy() { wicketFilter.destroy(); wicketFilter = null; } }
public void execute() { if ("GET".equalsIgnoreCase(this.request.getMethod()) || "POST".equalsIgnoreCase(this.request.getMethod())) { try { wicketFilter.doGet(this.request, this.response); } catch (ServletException e) { throw new ProcessingException(e); } catch (IOException e) { throw new ProcessingException(e); } } }
inPortletContext = filterPortletContext.setupFilter(getFilterConfig(), filterRequestContext, getFilterPath((HttpServletRequest)request)); httpServletRequest.setAttribute(FILTER_PATH_ATTR, getFilterPath(httpServletRequest)); final String relativePath = getRelativePath(httpServletRequest); if (isWicketRequest(relativePath)) long lastModified = getLastModified(httpServletRequest); if (lastModified == -1) boolean requestHandledByWicket = doGet(httpServletRequest, httpServletResponse); if (requestHandledByWicket == false) maybeSetLastModified(httpServletResponse, lastModified); doGet(httpServletRequest, httpServletResponse);
initIgnorePaths(filterConfig); final ClassLoader newClassLoader = getClassLoader(); try applicationFactory = getApplicationFactory(); application = applicationFactory.createApplication(this); String configureFilterPath = getFilterPath(); configureFilterPath = getFilterPathFromConfig(filterConfig); configureFilterPath = getFilterPathFromWebXml(isServlet, filterConfig); configureFilterPath = getFilterPathFromAnnotation(isServlet); setFilterPath(configureFilterPath); if (getFilterPath() == null) destroy();
String filterPath = getFilterPath(); if (!path.startsWith(filterPath))
initIgnorePaths(filterConfig); final ClassLoader newClassLoader = getClassLoader(); try filterPath = getFilterPath(filterConfig.getFilterName(), is); webApplicationFactory = getApplicationFactory(); if (isPortletContextAvailable(filterConfig)) filterPortletContext = newWicketFilterPortletContext();
if (webApplication.getWicketFilter().getFilterPath() == null) webApplication.getWicketFilter().setFilterPath("");
/** * If you do have a need to subclass, you may subclass {@link #init(boolean, FilterConfig)} * * @see javax.servlet.Filter#init(javax.servlet.FilterConfig) */ @Override public final void init(final FilterConfig filterConfig) throws ServletException { init(false, filterConfig); }
final ClassLoader newClassLoader = getClassLoader(); String filterPath = getFilterPath(httpServletRequest); if (shouldIgnorePath(httpServletRequest)) String redirectURL = checkIfRedirectRequired(httpServletRequest); if (redirectURL == null) res = processRequestCycle(requestCycle, webResponse, httpServletRequest, httpServletResponse, chain);