/** * Redirects browser to an intermediate page such as a sign-in page. The current request's url * is saved for future use by method continueToOriginalDestination(); Only use this method when * you plan to continue to the current url at some later time; otherwise just use * setResponsePage or - when you are in a constructor or checkAccessMethod, call redirectTo. * * @param page * The sign in page * * @see Component#continueToOriginalDestination() */ public final void redirectToInterceptPage(final Page page) { getPage().getPageMap().redirectToInterceptPage(page); }
/** * Redirects browser to an intermediate page such as a sign-in page. The current request's url * is saved for future use by method continueToOriginalDestination(); Only use this method when * you plan to continue to the current url at some later time; otherwise just use * setResponsePage or - when you are in a constructor or checkAccessMethod, call redirectTo. * * @param page * The sign in page * * @see Component#continueToOriginalDestination() */ public final void redirectToInterceptPage(final Page page) { getPage().getPageMap().redirectToInterceptPage(page); }
/** * Redirects to intercept page using the page map for the current request * * @param interceptPage * The intercept page to redirect to */ private void redirectToInterceptPage(final Page interceptPage) { final Page requestPage = RequestCycle.get().getRequest().getPage(); /* * requestPage can be null if we throw the restart response exception before any page is * instantiated in user's session. if this happens we switch to the pagemap of the * interceptPage */ final IPageMap pageMap; if (requestPage != null) { pageMap = requestPage.getPageMap(); } else { pageMap = interceptPage.getPageMap(); } pageMap.redirectToInterceptPage(interceptPage); }
/** * Redirects to intercept page using the page map for the current request * * @param interceptPage * The intercept page to redirect to */ private void redirectToInterceptPage(final Page interceptPage) { final Page requestPage = RequestCycle.get().getRequest().getPage(); /* * requestPage can be null if we throw the restart response exception before any page is * instantiated in user's session. if this happens we switch to the pagemap of the * interceptPage */ final IPageMap pageMap; if (requestPage != null) { pageMap = requestPage.getPageMap(); } else { pageMap = interceptPage.getPageMap(); } pageMap.redirectToInterceptPage(interceptPage); }
/** * Redirects to intercept page using the page map for the current request * * @param interceptPageClass * The intercept page class to redirect to */ private void redirectToInterceptPage(final Class interceptPageClass) { final RequestCycle cycle = RequestCycle.get(); final Page requestPage = cycle.getRequest().getPage(); /* * requestPage can be null if we throw the restart response exception before any page is * instantiated in user's session. if this happens we switch to the pagemap of the request. */ final IPageMap pageMap; if (requestPage != null) { pageMap = requestPage.getPageMap(); } else { RequestParameters parameters = cycle.getRequest().getRequestParameters(); pageMap = PageMap.forName(parameters.getPageMapName()); } pageMap.redirectToInterceptPage(interceptPageClass); } }
pageMap.redirectToInterceptPage(interceptPageClass);