Java Code Examples for org.apache.wicket.request.http.WebResponse#sendRedirect()
The following examples show how to use
org.apache.wicket.request.http.WebResponse#sendRedirect() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RedirectRequestHandler.java From onedev with MIT License | 6 votes |
/** {@inheritDoc} */ public void respond(final IRequestCycle requestCycle) { String location = requestCycle.getUrlRenderer().renderRelativeUrl(Url.parse(getRedirectUrl())); WebResponse response = (WebResponse)requestCycle.getResponse(); if (status == HttpServletResponse.SC_MOVED_TEMPORARILY) { response.sendRedirect(location); } else { response.setStatus(status); if (((WebRequest)requestCycle.getRequest()).isAjax()) { response.setHeader("Ajax-Location", location); } else { response.setHeader("Location", location); } } }
Example 2
Source File: DirectBuyRequestCycleListener.java From the-app with Apache License 2.0 | 5 votes |
private void redirectTo(RequestCycle cycle, Url urlWithoutDirectBuy) { Url requestUrl = cycle.getRequest().getUrl(); if (!requestUrl.equals(urlWithoutDirectBuy)) { WebResponse response = (WebResponse) cycle.getResponse(); response.reset(); response.sendRedirect(urlWithoutDirectBuy.toString(Url.StringMode.FULL)); } }
Example 3
Source File: DirectBuyRequestCycleListener.java From AppStash with Apache License 2.0 | 5 votes |
private void redirectTo(RequestCycle cycle, Url urlWithoutDirectBuy) { Url requestUrl = cycle.getRequest().getUrl(); if (!requestUrl.equals(urlWithoutDirectBuy)) { WebResponse response = (WebResponse) cycle.getResponse(); response.reset(); response.sendRedirect(urlWithoutDirectBuy.toString(Url.StringMode.FULL)); } }