public void sendRedirect(String uri) { exec().sendRedirect(uri); }
public void sendRedirect(String uri, String target) { exec().sendRedirect(uri, target); }
public void sendRedirect(String uri, boolean respRedirect) { exec().sendRedirect(uri, respRedirect); }
/** Sends a temporary redirect response to the client using the specified * redirect location URL by use of the current execution, * {@link #getCurrent}. * * <p>After calling this method, the caller shall end the processing * immediately (by returning). All pending requests and events will * be dropped. * * @param uri the URI to redirect to, or null to reload the same page * @see Execution#sendRedirect */ public static void sendRedirect(String uri) { getCurrent().sendRedirect(uri); }
protected void sendRedirect(HttpServletRequest request, HttpServletResponse response, String url) throws IOException { if (url == null) { return; //skip } final Event evt = (Event) (request).getSession().getAttribute(ZkEventExceptionFilter.EVENT); final Component comp = evt.getTarget(); final String updateURI = comp.getDesktop().getUpdateURI(null); if (url.indexOf(updateURI) >= 0) { //saved request Events.postEvent(new Event(ON_LOGIN_OK, comp, null)); //post onLoginOK event if (_resendZkEvent) { (request).getSession().removeAttribute(ZkEventExceptionFilter.EVENT); Events.postEvent(evt); } return; } //must redirect if (url.startsWith("http://") || url.startsWith("https://")) { Executions.getCurrent().sendRedirect(url); return; } //other url, assume login fail if (!comp.isListenerAvailable(ZkAuthenticationEntryPoint.ON_ACEGILOGIN, true)) { final EventListener<Event> listener = new ShowWindowEventListener<Event>(); comp.setAttribute(ZkAuthenticationEntryPoint.ON_ACEGILOGIN, listener); comp.addEventListener(ZkAuthenticationEntryPoint.ON_ACEGILOGIN, listener); } Events.postEvent(new Event(ZkAuthenticationEntryPoint.ON_ACEGILOGIN, comp, url)); }
log.debug("Redirecting Desktop to logout filter URI: " + contextDesktop); String queryParam = replaceParam(replaceParam(logoutTarget, "%target%", target), "%message%", message); contextDesktop.getExecution().sendRedirect(Constants.LOGOUT_URI + queryParam); Application.getInstance().register(contextDesktop, false);