@Override protected Response getRealResponse() { return RequestCycle.get().getResponse(); } }
/** * @return The response for this component's active request cycle */ public final Response getResponse() { return getRequestCycle().getResponse(); }
@Override protected Response getRealResponse() { return RequestCycle.get().getResponse(); } }
/** * @return The response for this component's active request cycle */ public final Response getResponse() { return getRequestCycle().getResponse(); }
@Override public String encode(final String url) { String[] elements = StringUtils.split(url, '/'); for (int i = 0; i < elements.length; i++) { elements[i] = org.apache.wicket.util.encoding.UrlEncoder.PATH_INSTANCE.encode(elements[i], "UTF-8"); } final String encodedUrl = StringUtils.join(elements, '/'); RequestCycle requestCycle = RequestCycle.get(); return requestCycle != null ? requestCycle.getResponse().encodeURL(encodedUrl).toString() : encodedUrl; } }
/** * Gets the http servlet response. * * @return the http servlet response */ public static HttpServletResponse getHttpServletResponse() { final Response response = RequestCycle.get().getResponse(); return getHttpServletResponse(response); }
@Override public void onClick(AjaxRequestTarget target) { showChangeHistory = !showChangeHistory; WebResponse response = (WebResponse) RequestCycle.get().getResponse(); Cookie cookie = new Cookie(COOKIE_SHOW_CHANGE_HISTORY, String.valueOf(showChangeHistory)); cookie.setPath("/"); cookie.setMaxAge(Integer.MAX_VALUE); response.addCookie(cookie); target.add(container); target.appendJavaScript(String.format("$('#%s').toggleClass('active');", getMarkupId())); }
@Override public void onClick(AjaxRequestTarget target) { showChangeHistory = !showChangeHistory; WebResponse response = (WebResponse) RequestCycle.get().getResponse(); Cookie cookie = new Cookie(COOKIE_SHOW_CHANGE_HISTORY, String.valueOf(showChangeHistory)); cookie.setPath("/"); cookie.setMaxAge(Integer.MAX_VALUE); response.addCookie(cookie); target.add(IssueActivitiesPanel.this); target.appendJavaScript(String.format("$('#%s').toggleClass('active');", getMarkupId())); }
protected Page mapExceptions(Exception e) { HttpServletResponse response = (HttpServletResponse) RequestCycle.get().getResponse().getContainerResponse(); if (!response.isCommitted()) return new ErrorPage(e); else return null; }
@Override public void close() { // write the stuff that was actually supposed to be in the header to the // response, which is used by the built-in HtmlHeaderContainer to get // its contents CharSequence headerContent = getContent(headerFilterName); RequestCycle.get().getResponse().write(headerContent); // must make sure our super (and with it, the wrapped response) get closed: super.close(); }
@Override public void beforeRender(Component component) { super.beforeRender(component); final RequestCycle requestCycle = RequestCycle.get(); // Temporarily replace the web response with a String response originalResponse = requestCycle.getResponse(); WebResponse origResponse = (WebResponse)((originalResponse instanceof WebResponse) ? originalResponse : null); BufferedWebResponse tempResponse = newResponse(origResponse); // temporarily set StringResponse to collect the transformed output requestCycle.setResponse(tempResponse); }
@Override protected void onRender() { // Configure the response such as headers etc. configureResponse((WebResponse)RequestCycle.get().getResponse()); // The rules if and when to insert an xml decl in the response are a bit tricky. Allow the // user to replace the default per page and per application. renderXmlDecl(); super.onRender(); }
@Override public void close() { // write the stuff that was actually supposed to be in the header to the // response, which is used by the built-in HtmlHeaderContainer to get // its contents CharSequence headerContent = getContent(headerFilterName); RequestCycle.get().getResponse().write(headerContent); // must make sure our super (and with it, the wrapped response) get closed: super.close(); }
/** * * @param url * @param requestCycle */ protected void redirectTo(Url url, RequestCycle requestCycle) { bindSessionIfNeeded(); WebResponse response = (WebResponse)requestCycle.getResponse(); String relativeUrl = requestCycle.getUrlRenderer().renderUrl(url); response.sendRedirect(relativeUrl); }
/** * * @param url * @param requestCycle */ protected void redirectTo(Url url, RequestCycle requestCycle) { bindSessionIfNeeded(); WebResponse response = (WebResponse)requestCycle.getResponse(); String relativeUrl = requestCycle.getUrlRenderer().renderUrl(url); response.sendRedirect(relativeUrl); }
/** * @param parameters * page parameters */ public final void onResourceRequested(PageParameters parameters) { bind(); RequestCycle requestCycle = RequestCycle.get(); Attributes attributes = new Attributes(requestCycle.getRequest(), requestCycle.getResponse(), parameters); resource.respond(attributes); }
/** * @param parameters * page parameters */ public final void onResourceRequested(PageParameters parameters) { bind(); RequestCycle requestCycle = RequestCycle.get(); Attributes attributes = new Attributes(requestCycle.getRequest(), requestCycle.getResponse(), parameters); resource.respond(attributes); }
@Override public final void onRequest() { Attributes a = new Attributes(RequestCycle.get().getRequest(), RequestCycle.get() .getResponse(), null); resource.respond(a); super.onRequest(); } }
@Override public final void onRequest() { Attributes a = new Attributes(RequestCycle.get().getRequest(), RequestCycle.get() .getResponse(), null); resource.respond(a); super.onRequest(); } }
@Override public void onRequest() { final RequestCycle requestCycle = RequestCycle.get(); final Response response = requestCycle.getResponse(); ((WebResponse) response).addCookie(cookie(getName())); Attributes a = new Attributes(requestCycle.getRequest(), response, null); resource.respond(a); }