/** * Gets the path info if any. * * @return Any servlet path info */ @Override public String getPath() { return ((WebApplication)Application.get()).getWicketFilter().getRelativePath( httpServletRequest); }
@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; } }
/** * Gets the path info if any. * * @return Any servlet path info */ public String getPath() { return ((WebApplication)Application.get()).getWicketFilter().getRelativePath( httpServletRequest); }
public void bind(Component component) { parameters.put("id", component.getMarkupId()); parameters.put("filterName", WebApplication.get().getWicketFilter().getFilterConfig().getFilterName()); }
/** * Gets the prefix for storing variables in the actual session (typically {@link HttpSession} * for this application instance. * * @param request * the request * * @return the prefix for storing variables in the actual session */ public String getSessionAttributePrefix(final WebRequest request) { if (sessionAttributePrefix == null) { sessionAttributePrefix = "wicket:" + getWicketFilter().getFilterConfig().getFilterName() + ":"; } // Namespacing for session attributes is provided by // adding the servlet path return sessionAttributePrefix; }
/** * Gets the prefix for storing variables in the actual session (typically {@link HttpSession} * for this application instance. * * @param request * the request * @param filterName * If null, than it defaults to the WicketFilter filter name. However according to * the ServletSpec the Filter is not guaranteed to be initialized e.g. when * WicketSessionFilter gets initialized. Thus, though you (and WicketSessionFilter) * can provide a filter name, you must make sure it is the same as WicketFilter will * provide once initialized. * * @return the prefix for storing variables in the actual session */ public String getSessionAttributePrefix(final WebRequest request, String filterName) { if (sessionAttributePrefix == null) { if (filterName == null) { // According to the ServletSpec, the filter might not yet been initialized filterName = getWicketFilter().getFilterConfig().getFilterName(); } sessionAttributePrefix = "wicket:" + filterName + ":"; } // Namespacing for session attributes is provided by // adding the servlet path return sessionAttributePrefix; }
/** * @param name the file name * @param disposition the disposition * @param ref the reference * @return the URL do download */ public String addAttachment(String name, ContentDisposition disposition, IAttachmentRef ref) { WebApplication app = WebApplication.get(); attachments.put(ref.getId(), new Attachment(name, disposition, ref)); String path = app.getServletContext().getContextPath() + "/" + app.getWicketFilter().getFilterPath() + getDownloadURL(Session.get().getId(), ref.getId()); return path.replaceAll("\\*", "").replaceAll("//", "/"); }
if (webApplication.getWicketFilter().getFilterPath() == null) webApplication.getWicketFilter().setFilterPath("");
if (webApplication.getWicketFilter().getFilterPath() == null) webApplication.getWicketFilter().setFilterPath("");
if (webApplication.getWicketFilter().getFilterPath() == null) webApplication.getWicketFilter().setFilterPath("");
if (webApplication.getWicketFilter().getFilterPath() == null) webApplication.getWicketFilter().setFilterPath("");
/** * 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); }
filterName = getWicketFilter().getFilterConfig().getFilterName();
private void post(AtmosphereResource resource, PageKey pageKey, Collection<EventSubscription> subscriptionsForPage, AtmosphereEvent event) { String filterPath = WebApplication.get() .getWicketFilter() .getFilterConfig() .getInitParameter(WicketFilter.FILTER_MAPPING_PARAM); filterPath = filterPath.substring(1, filterPath.length() - 1); HttpServletRequest httpRequest = new HttpServletRequestWrapper(resource.getRequest()) { @Override public String getContextPath() { String ret = super.getContextPath(); return ret == null ? "" : ret; } }; AtmosphereWebRequest request = new AtmosphereWebRequest( (ServletWebRequest)application.newWebRequest(httpRequest, filterPath), pageKey, subscriptionsForPage, event); Response response = new AtmosphereWebResponse(resource.getResponse()); if (application.createRequestCycle(request, response).processRequestAndDetach()) broadcaster.broadcast(response.toString(), resource); }
/** * 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); }
filterName = getWicketFilter().getFilterConfig().getFilterName();
/** * 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); }
private void post(AtmosphereResource resource, PageKey pageKey, Iterator<EventSubscription> subscriptionsForPage, AtmosphereEvent event) { String filterPath = WebApplication.get() .getWicketFilter() .getFilterConfig() .getInitParameter(WicketFilter.FILTER_MAPPING_PARAM); filterPath = filterPath.substring(1, filterPath.length() - 1); HttpServletRequest httpRequest = new HttpServletRequestWrapper(resource.getRequest()) { @Override public String getContextPath() { String ret = super.getContextPath(); return ret == null ? "" : ret; } }; AtmosphereWebRequest request = new AtmosphereWebRequest( (ServletWebRequest)application.newWebRequest(httpRequest, filterPath), pageKey, subscriptionsForPage, event); Response response = new AtmosphereWebResponse(resource.getResponse()); if (application.createRequestCycle(request, response).processRequestAndDetach()) getBroadcaster().broadcast(response.toString(), resource); }