Package org.springframework.security.web.savedrequest

Examples of org.springframework.security.web.savedrequest.HttpSessionRequestCache


    private RequestCache getRequestCache(H http) {
        RequestCache result = http.getSharedObject(RequestCache.class);
        if(result != null) {
            return result;
        }
        HttpSessionRequestCache defaultCache = new HttpSessionRequestCache();
        defaultCache.setRequestMatcher(createDefaultSavedRequestMatcher(http));
        return defaultCache;
    }
View Full Code Here


    private RequestCache getRequestCache(H http) {
        RequestCache result = http.getSharedObject(RequestCache.class);
        if(result != null) {
            return result;
        }
        return new HttpSessionRequestCache();
    }
View Full Code Here

    @Deprecated
    public ExceptionTranslationFilter() {
    }

    public ExceptionTranslationFilter(AuthenticationEntryPoint authenticationEntryPoint) {
        this(authenticationEntryPoint, new HttpSessionRequestCache());
    }
View Full Code Here

        if (session == null) {
            return null;
        }

        HttpSessionRequestCache rc = new HttpSessionRequestCache();
        SavedRequest sr = rc.getRequest(request, new MockHttpServletResponse());

        return sr.getRedirectUrl();
    }
View Full Code Here

        doThrow(new BadCredentialsException("")).when(fc).doFilter(any(HttpServletRequest.class), any(HttpServletResponse.class));

        // Test
        ExceptionTranslationFilter filter = new ExceptionTranslationFilter();
        filter.setAuthenticationEntryPoint(mockEntryPoint);
        HttpSessionRequestCache requestCache = new HttpSessionRequestCache();
        requestCache.setPortResolver(new MockPortResolver(8080, 8443));
        filter.setRequestCache(requestCache);
        filter.afterPropertiesSet();
        MockHttpServletResponse response = new MockHttpServletResponse();
        filter.doFilter(request, response, fc);
        assertEquals("/mycontext/login.jsp", response.getRedirectedUrl());
View Full Code Here

        final Guest guest = AuthHelper.getGuest();
        if (!hasTimezoneCookie(request)|| guest ==null)
            return new ModelAndView("redirect:/welcome");
        long guestId = guest.getId();
        checkIn(request, guestId);
        final HttpSessionRequestCache requestCache = new HttpSessionRequestCache();
        SavedRequest savedRequest =
                requestCache.getRequest(request, response);
        if (savedRequest!=null) {
            final String redirectUrl = savedRequest.getRedirectUrl();
            requestCache.removeRequest(request, response);
            return new ModelAndView("redirect:" + redirectUrl);
        }
        return new ModelAndView("redirect:/app");
    }
View Full Code Here

    public ModelAndView mobileCheckIn(HttpServletRequest request,
                                      HttpServletResponse response) throws IOException, NoSuchAlgorithmException, URISyntaxException {
        final Guest guest = AuthHelper.getGuest();
        long guestId = guest.getId();
        checkIn(request, guestId);
        final HttpSessionRequestCache requestCache = new HttpSessionRequestCache();
        SavedRequest savedRequest =
                requestCache.getRequest(request, response);
        if (savedRequest!=null) {
            final String redirectUrl = savedRequest.getRedirectUrl();
            requestCache.removeRequest(request, response);
            return new ModelAndView("redirect:" + redirectUrl);
        }
        return new ModelAndView("redirect:/app");
    }
View Full Code Here

        // always reset the target user to the logged in user when the app starts (or a browser reload happens)
        AuthHelper.as(null);
    if (!hasTimezoneCookie(request)|| AuthHelper.getGuest()==null)
      return new ModelAndView("redirect:/welcome?signIn");
        SavedRequest savedRequest =
                new HttpSessionRequestCache().getRequest(request, response);
        if (savedRequest!=null) {
            final String redirectUrl = savedRequest.getRedirectUrl();
            return new ModelAndView(redirectUrl);
        }
        return home(request, response);
View Full Code Here

    private RequestCache getRequestCache(H http) {
        RequestCache result = http.getSharedObject(RequestCache.class);
        if(result != null) {
            return result;
        }
        return new HttpSessionRequestCache();
    }
View Full Code Here

    private RequestCache getRequestCache(H http) {
        RequestCache result = http.getSharedObject(RequestCache.class);
        if(result != null) {
            return result;
        }
        return new HttpSessionRequestCache();
    }
View Full Code Here

TOP

Related Classes of org.springframework.security.web.savedrequest.HttpSessionRequestCache

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.