/** * Retrieves default charset configured in application * * @return charset */ private static String getDefaultEncoding() { return Application.get().getRequestCycleSettings().getResponseRequestEncoding(); }
public void initFilter(FilterConfig filterConfig, WebApplication webApplication) throws ServletException { webApplication.getRequestCycleSettings().setRenderStrategy( IRequestCycleSettings.REDIRECT_TO_RENDER); webApplication.getRequestCycleSettings() .addResponseFilter(new PortletInvalidMarkupFilter()); }
public Object getObject() { GeoServerApplication app = GeoServerApplication.get(); boolean enabled = false; for (Object filter : app.getRequestCycleSettings().getResponseFilters()) { if(filter instanceof GeoServerHTMLValidatorResponseFilter) { enabled = ((GeoServerHTMLValidatorResponseFilter) filter).enabled; } } return enabled; }
.getResponseRequestEncoding()); if (webApplication.getRequestCycleSettings().getRenderStrategy() == IRequestCycleSettings.REDIRECT_TO_BUFFER) response.setAjax(request.isAjax()); response.setCharacterEncoding(webApplication.getRequestCycleSettings() .getResponseRequestEncoding());
this.application.getRequestCycleSettings().setRenderStrategy( IRequestCycleSettings.ONE_PASS_RENDER); this.application.getRequestCycleSettings().setBufferResponse(false); if (this.application.getResourceFinder() == null)
htmlvalidator.setIgnoreAutocomplete(true); htmlvalidator.setIgnoreKnownWicketBugs(true); getRequestCycleSettings().addResponseFilter(htmlvalidator);
getRequestCycleSettings().setRenderStrategy(RenderStrategy.REDIRECT_TO_RENDER);
/** * Create a WebResponse. Subclasses of WebRequest could e.g. encode wicket's default URL and * hide the details from the user. A appropriate WebRequest must be implemented and configured * to decode the encoded URL. * * @param servletResponse * @return a WebResponse object */ protected WebResponse newWebResponse(final HttpServletResponse servletResponse) { return (getRequestCycleSettings().getBufferResponse() ? new BufferedWebResponse( servletResponse) : new WebResponse(servletResponse)); }
/** * @see org.apache.wicket.RequestCycle#newClientInfo() */ protected ClientInfo newClientInfo() { if (getApplication().getRequestCycleSettings().getGatherExtendedBrowserInfo()) { Session session = getSession(); if (session.getMetaData(BROWSER_WAS_POLLED_KEY) == null) { // we haven't done the redirect yet; record that we will be // doing that now and redirect session.setMetaData(BROWSER_WAS_POLLED_KEY, Boolean.TRUE); String url = "/" + getRequest().getURL(); throw new RestartResponseException(new BrowserInfoPage(url)); } // if we get here, the redirect already has been done; clear // the meta data entry; we don't need it any longer is the client // info object will be cached too session.setMetaData(BROWSER_WAS_POLLED_KEY, (Boolean)null); } return new WebClientInfo(this); }
if (webApplication.getRequestCycleSettings().getRenderStrategy() == IRequestCycleSettings.REDIRECT_TO_BUFFER) response.setAjax(request.isAjax()); response.setCharacterEncoding(webApplication.getRequestCycleSettings() .getResponseRequestEncoding());
this.application.getRequestCycleSettings().setRenderStrategy( IRequestCycleSettings.ONE_PASS_RENDER); this.application.getRequestCycleSettings().setBufferResponse(false); this.application.getResourceSettings().setResourceFinder(new WebApplicationPath(context)); this.application.getPageSettings().setAutomaticMultiWindowSupport(false);
getRequestCycleSettings().addResponseFilter(EmptySrcAttributeCheckFilter.INSTANCE);
/** * Create a WebResponse. Subclasses of WebRequest could e.g. encode wicket's default URL and * hide the details from the user. A appropriate WebRequest must be implemented and configured * to decode the encoded URL. * * @param servletResponse * @return a WebResponse object */ protected WebResponse newWebResponse(final HttpServletResponse servletResponse) { return (getRequestCycleSettings().getBufferResponse() ? new BufferedWebResponse( servletResponse) : new WebResponse(servletResponse)); }
protected ClientInfo newClientInfo() if (getApplication().getRequestCycleSettings().getGatherExtendedBrowserInfo())
/** * Url encodes a string * * @param string * string to be encoded * @return encoded string */ protected String urlEncode(String string) { try { return URLEncoder.encode(string, Application.get().getRequestCycleSettings() .getResponseRequestEncoding()); } catch (UnsupportedEncodingException e) { log.error(e.getMessage(), e); return string; } }
/** * Overrides render strategy and adds the {@link PortletInvalidMarkupFilter} filter. * * @see PortletInvalidMarkupFilter * @param webApplication */ public void initFilter(FilterConfig filterConfig, WebApplication webApplication) throws ServletException { // override render strategy to REDIRECT_TO_REDNER webApplication.getRequestCycleSettings().setRenderStrategy( IRequestCycleSettings.REDIRECT_TO_RENDER); // Add response filter to remove extra HTML such as <body> etc as they are not appropriate // for portlet environments webApplication.getRequestCycleSettings() .addResponseFilter(new PortletInvalidMarkupFilter()); }
public void setObject(Object object) { GeoServerApplication app = GeoServerApplication.get(); for (Object filter : app.getRequestCycleSettings().getResponseFilters()) { if(filter instanceof GeoServerHTMLValidatorResponseFilter) { ((GeoServerHTMLValidatorResponseFilter) filter).enabled = (Boolean) object; } } }
application.getMarkupSettings().getStripWicketTags())); add(new Label("bufferResponse", "" + application.getRequestCycleSettings().getBufferResponse())); add(new Label("resourcePollFrequency", "" + application.getResourceSettings().getResourcePollFrequency()));
/** * Returns a decoded value of the given value * * @param value * @return Decodes the value */ protected String urlDecode(String value) { try { value = URLDecoder.decode(value, Application.get().getRequestCycleSettings() .getResponseRequestEncoding()); } catch (UnsupportedEncodingException ex) { log.error("error decoding parameter", ex); } return value; }
/** * THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT USE IT. * * Loops over all the response filters that were set (if any) with the give response returns the * response buffer itself if there where now filters or the response buffer that was * created/returned by the filter(s) * * @param responseBuffer * The response buffer to be filtered * @return Returns the filtered string buffer. */ public final AppendingStringBuffer filter(AppendingStringBuffer responseBuffer) { List responseFilters = Application.get().getRequestCycleSettings().getResponseFilters(); if (responseFilters == null) { return responseBuffer; } for (int i = 0; i < responseFilters.size(); i++) { IResponseFilter filter = (IResponseFilter)responseFilters.get(i); responseBuffer = filter.filter(responseBuffer); } return responseBuffer; }