Examples of DefaultRedirectStrategy


Examples of org.apache.http.impl.client.DefaultRedirectStrategy

        this.keepAliveStrategy = keepAliveStrategy;
    }

    public synchronized final RedirectStrategy getRedirectStrategy() {
        if (this.redirectStrategy == null) {
            this.redirectStrategy = new DefaultRedirectStrategy();
        }
        return this.redirectStrategy;
    }
View Full Code Here

Examples of org.apache.http.impl.client.DefaultRedirectStrategy

        params.setBooleanParameter(CoreConnectionPNames.TCP_NODELAY,true);
        params.setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK,false);
        params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT,socketTimeOut);
        params.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,connectionTimeOut);
        client = new DefaultHttpClient(httpConnectionManager,params);
        client.setRedirectStrategy(new DefaultRedirectStrategy());
        core.addCloseHook(new CloseHandler());
      }
    }
  }
View Full Code Here

Examples of org.apache.http.impl.client.DefaultRedirectStrategy

    params.setBooleanParameter(CoreConnectionPNames.TCP_NODELAY,true);
    params.setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK,false);
    params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT,socketTimeOut);
    params.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,connectionTimeOut);
    client = new DefaultHttpClient(httpConnectionManager,params);
    client.setRedirectStrategy(new DefaultRedirectStrategy());
  }
View Full Code Here

Examples of org.apache.http.impl.client.DefaultRedirectStrategy

    }

    @Test
    public void testServletFormAuth() throws IOException {
        TestHttpClient client = new TestHttpClient();
        client.setRedirectStrategy(new DefaultRedirectStrategy() {
            @Override
            public boolean isRedirected(final HttpRequest request, final HttpResponse response, final HttpContext context) throws ProtocolException {
                if (response.getStatusLine().getStatusCode() == StatusCodes.FOUND) {
                    return true;
                }
View Full Code Here

Examples of org.apache.http.impl.client.DefaultRedirectStrategy

    }

    @Test
    public void testServletFormAuthWithSavedPostBody() throws IOException {
        TestHttpClient client = new TestHttpClient();
        client.setRedirectStrategy(new DefaultRedirectStrategy() {
            @Override
            public boolean isRedirected(final HttpRequest request, final HttpResponse response, final HttpContext context) throws ProtocolException {
                if (response.getStatusLine().getStatusCode() == StatusCodes.FOUND) {
                    return true;
                }
View Full Code Here

Examples of org.apache.http.impl.client.DefaultRedirectStrategy


    @Test
    public void testServletFormAuthWithOriginalRequestParams() throws IOException {
        TestHttpClient client = new TestHttpClient();
        client.setRedirectStrategy(new DefaultRedirectStrategy() {
            @Override
            public boolean isRedirected(final HttpRequest request, final HttpResponse response, final HttpContext context) throws ProtocolException {
                if (response.getStatusLine().getStatusCode() == StatusCodes.FOUND) {
                    return true;
                }
View Full Code Here

Examples of org.apache.http.impl.client.DefaultRedirectStrategy

    }

    private TestHttpClient createHttpClient() {
        TestHttpClient client = new TestHttpClient();

        client.setRedirectStrategy(new DefaultRedirectStrategy() {
            @Override
            public boolean isRedirected(final HttpRequest request, final HttpResponse response, final HttpContext context) throws ProtocolException {
                if (response.getStatusLine().getStatusCode() == StatusCodes.FOUND) {
                    return true;
                }
View Full Code Here

Examples of org.springframework.security.web.DefaultRedirectStrategy

      OpenIDAuthenticationToken token = (OpenIDAuthenticationToken)exception.getAuthentication();
      String url = token.getIdentityUrl();
      User user = createTemporaryUser(token, url);
      request.getSession(true).setAttribute(ModelKeys.NEW_USER, user);

      DefaultRedirectStrategy redirectStrategy = new DefaultRedirectStrategy();
      log.info("Redirecting to new user account creation page");
      super.setRedirectStrategy(redirectStrategy);
      redirectStrategy.sendRedirect(request, response, "/"+ViewNames.CREATE_ACCOUNT_PAGE);
      return;
    } else {
      super.onAuthenticationFailure(request, response, exception);
    }
  }
View Full Code Here

Examples of org.springframework.security.web.DefaultRedirectStrategy

        MockHttpServletResponse response = new MockHttpServletResponse();

        // Setup our test fixture and registry to want this session to be expired
        ConcurrentSessionFilter filter = new ConcurrentSessionFilter();
        filter.setRedirectStrategy(new DefaultRedirectStrategy());
        filter.setLogoutHandlers(new LogoutHandler[] {new SecurityContextLogoutHandler()});

        SessionRegistry registry = new SessionRegistryImpl();
        registry.registerNewSession(session.getId(), "principal");
        registry.getSessionInformation(session.getId()).expireNow();
View Full Code Here

Examples of org.springframework.security.web.DefaultRedirectStrategy

        SwitchUserFilter filter = new SwitchUserFilter();
        filter.setSwitchUserUrl("/j_spring_security_switch_user");
        SimpleUrlAuthenticationSuccessHandler switchSuccessHandler =
            new SimpleUrlAuthenticationSuccessHandler("/someOtherUrl");
        DefaultRedirectStrategy contextRelativeRedirector = new DefaultRedirectStrategy();
        contextRelativeRedirector.setContextRelative(true);
        switchSuccessHandler.setRedirectStrategy(contextRelativeRedirector);
        filter.setSuccessHandler(switchSuccessHandler);
        filter.setUserDetailsService(new MockUserDetailsService());

        FilterChain chain = mock(FilterChain.class);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.