/** * Send a 302 redirect response. * * @param url * The Location to redirect */ protected static void redirect(String url) { redirect(url, false); }
/** * 302 Redirect to another action * * @param action * The fully qualified action name (ex: Application.index) * @param args * Method arguments */ public static void redirect(String action, Object... args) { redirect(action, false, args); }
/** * Send a Redirect response. * * @param url * The Location to redirect * @param permanent * true -> 301, false -> 302 */ protected static void redirect(String url, boolean permanent) { if (url.indexOf("/") == -1) { // fix Java ! redirect(url, permanent, new Object[0]); } throw new Redirect(url, permanent); }