@Test public void testSetRedirectAfterLogin() throws Exception { MockHttpServletResponse res = new MockHttpServletResponse(); loginController = (LoginController) context.getBean("loginController"); loginController.setRedirectAfterLoginCookie(res); Cookie[] cookies = res.getCookies(); boolean contains = false; String url = null; for (Cookie cookie : cookies){ if (cookie.getName().equalsIgnoreCase("redirectAfterLogin")){ contains = true; url = cookie.getValue(); } } assertTrue(contains); assertEquals(url, "tasks.htm"); }
public void setRedirectAfterLoginCookie(HttpServletResponse response) { setRedirectAfterLoginCookie(response, _defaultRedirectAfterLogin); }
LoginController extends UIController { public void setRedirectAfterLoginCookie(HttpServletResponse response) { setRedirectAfterLoginCookie(response, _defaultRedirectAfterLogin); } }
LoginController extends UIController { public void setRedirectAfterLoginCookie(HttpServletResponse response) { setRedirectAfterLoginCookie(response, _defaultRedirectAfterLogin); } LoginController(TokenService tokenService, String redirectSuccessfulLogin); }
LoginController extends UIController { public void setRedirectAfterLoginCookie(HttpServletResponse response) { setRedirectAfterLoginCookie(response, _defaultRedirectAfterLogin); } LoginController(TokenService tokenService, String redirectSuccessfulLogin); String getLoginPageURL(); void setLoginPageURL(String url); static ModelAndView redirect(String url); ModelAndView redirectAfterLogin(HttpServletRequest request, HttpServletResponse response); static void clearAutoLogin(HttpServletResponse response); static void clearSingleLogin(HttpServletResponse response); static void clearSecureRandom(HttpServletResponse response); static void clearRootCookie(HttpServletResponse response); static String getSecureRandomCookie(HttpServletRequest request); static String getSecureRandomSession(HttpServletRequest request); static void setSecureRandomSession(HttpServletRequest request, String secureRandom); static void generateSecureRandom(HttpServletRequest request, HttpServletResponse response); static String generateSecureRandom(); static String bytesToHex(byte[] bytes); static void clearCookie(String cookieName, HttpServletResponse response); static void clearOtherCookie(HttpServletResponse response,String cookieName,String path); static String extractUser(Property[] props); static String[] extractRoles(Property[] props); User getCurrentUser(HttpServletRequest request); void setRedirectAfterLoginCookie(HttpServletResponse response); static void setRedirectAfterLoginCookie(HttpServletResponse response, String url); static void setAutoLoginCookie(HttpServletResponse response, String token); static void setSingleLoginCookie(HttpServletResponse response, String token); List<String> getGrantedRoles(); void setGrantedRoles(List<String> roles); String arrayToString(String[] stringArray, String delimiter); void executePost(PostMethod post); @SuppressWarnings("unchecked") ModelAndView logIn(HttpServletRequest request, HttpServletResponse response, LoginCommand login,
            BindException errors); ModelAndView logOut(HttpServletRequest request, HttpServletResponse response, LoginCommand login,
            BindException errors); }
LoginController extends UIController { public void setRedirectAfterLoginCookie(HttpServletResponse response) { setRedirectAfterLoginCookie(response, _defaultRedirectAfterLogin); } LoginController(TokenService tokenService, String redirectSuccessfulLogin); String getLoginPageURL(); void setLoginPageURL(String url); static ModelAndView redirect(String url); ModelAndView redirectAfterLogin(HttpServletRequest request, HttpServletResponse response); static void clearAutoLogin(HttpServletResponse response); static void clearSingleLogin(HttpServletResponse response); static void clearSecureRandom(HttpServletResponse response); static void clearRootCookie(HttpServletResponse response); static String getSecureRandomCookie(HttpServletRequest request); static String getSecureRandomSession(HttpServletRequest request); static void setSecureRandomSession(HttpServletRequest request, String secureRandom); static void generateSecureRandom(HttpServletRequest request, HttpServletResponse response); static String generateSecureRandom(); static String bytesToHex(byte[] bytes); static void clearCookie(String cookieName, HttpServletResponse response); static void clearOtherCookie(HttpServletResponse response,String cookieName,String path); static String extractUser(Property[] props); static String[] extractRoles(Property[] props); User getCurrentUser(HttpServletRequest request); void setRedirectAfterLoginCookie(HttpServletResponse response); static void setRedirectAfterLoginCookie(HttpServletResponse response, String url); static void setAutoLoginCookie(HttpServletResponse response, String token); static void setSingleLoginCookie(HttpServletResponse response, String token); List<String> getGrantedRoles(); void setGrantedRoles(List<String> roles); String arrayToString(String[] stringArray, String delimiter); void executePost(PostMethod post); @SuppressWarnings("unchecked") ModelAndView logIn(HttpServletRequest request, HttpServletResponse response, LoginCommand login,
            BindException errors); ModelAndView logOut(HttpServletRequest request, HttpServletResponse response, LoginCommand login,
            BindException errors); static final String AUTO_LOGIN_ID; static final String SINGLE_LOGIN_ID; static final String REDIRECT_AFTER_LOGIN; static final String SECURE_RANDOM; static final String JSESSION; static final String UI_FW; static final String MONITORING; static final String BPMS_CONSOLE; }