Example usage for org.springframework.web.context.request WebRequest removeAttribute

List of usage examples for org.springframework.web.context.request WebRequest removeAttribute

Introduction

In this page you can find the example usage for org.springframework.web.context.request WebRequest removeAttribute.

Prototype

void removeAttribute(String name, int scope);

Source Link

Document

Remove the scoped attribute of the given name, if it exists.

Usage

From source file:org.focusns.web.console.ConsoleController.java

@RequestMapping("/logout")
public String logout(WebRequest webRequest) {
    ///*  w  ww  .j ava  2  s .  c o  m*/
    webRequest.removeAttribute("user", WebRequest.SCOPE_SESSION);
    //
    return "redirect:/console";
}

From source file:rd.kpath.twitter.TweetAfterConnectInterceptor.java

public void postConnect(Connection<Twitter> connection, WebRequest request) {
    if (request.getAttribute(POST_TWEET_ATTRIBUTE, WebRequest.SCOPE_SESSION) != null) {
        try {/*from   w  w  w . j  ava 2  s  . c  om*/
            connection.updateStatus("I've connected with the K-Path!");
        } catch (DuplicateStatusException e) {
        }
        request.removeAttribute(POST_TWEET_ATTRIBUTE, WebRequest.SCOPE_SESSION);
    }
}

From source file:com.springsource.greenhouse.connect.TwitterConnectInterceptor.java

public void postConnect(Connection<Twitter> connection, WebRequest request) {
    if (request.getAttribute(POST_TWEET_ATTRIBUTE, WebRequest.SCOPE_SESSION) != null) {
        connection.getApi().timelineOperations()
                .updateStatus("Join me at the Greenhouse! " + AccountUtils.getCurrentAccount().getProfileUrl());
        request.removeAttribute(POST_TWEET_ATTRIBUTE, WebRequest.SCOPE_SESSION);
    }/*from w ww.  j  a  va2  s  .c o  m*/
}

From source file:eu.gyza.eap.eapsocialontology.twitter.TweetAfterConnectInterceptor.java

public void postConnect(Connection<Twitter> connection, WebRequest request) {
    if (request.getAttribute(POST_TWEET_ATTRIBUTE, WebRequest.SCOPE_SESSION) != null) {
        try {//from w ww. j a  v a  2 s.  c o m
            connection.updateStatus("I've connected with the EAP Social Ontology!");
        } catch (DuplicateStatusException e) {
        }
        request.removeAttribute(POST_TWEET_ATTRIBUTE, WebRequest.SCOPE_SESSION);
    }
}

From source file:org.fuzzydb.samples.social.TweetAfterConnectInterceptor.java

public void postConnect(Connection<Twitter> connection, WebRequest request) {
    if (request.getAttribute(POST_TWEET_ATTRIBUTE, WebRequest.SCOPE_SESSION) != null) {
        try {// w w  w  .  j a  va  2s . c o m
            connection.updateStatus("I've connected with the @fuzzydb sample webapp");
        } catch (DuplicateStatusException e) {
        }
        request.removeAttribute(POST_TWEET_ATTRIBUTE, WebRequest.SCOPE_SESSION);
    }
}

From source file:com.kdubb.socialshowcaseboot.twitter.TweetAfterConnectInterceptor.java

public void postConnect(Connection<Twitter> connection, WebRequest request) {
    if (request.getAttribute(POST_TWEET_ATTRIBUTE, WebRequest.SCOPE_SESSION) != null) {
        try {/*from www.  ja va2 s.  c  o m*/
            connection.updateStatus("I've connected with the Spring Social Showcase!");
        } catch (DuplicateStatusException e) {
        }
        request.removeAttribute(POST_TWEET_ATTRIBUTE, WebRequest.SCOPE_SESSION);
    }
}

From source file:com.bg.jtown.social.twitter.TweetAfterSignInInterceptor.java

public void postConnect(Connection<Twitter> connection, WebRequest request) {
    if (request.getAttribute(POST_TWEET_ATTRIBUTE, WebRequest.SCOPE_SESSION) != null) {
        try {//from ww  w .j  ava2s  .  c  om
            connection.updateStatus("I've signin with the Mirros!");
            //TODO updateStatus  
        } catch (DuplicateStatusException e) {
        }
        request.removeAttribute(POST_TWEET_ATTRIBUTE, WebRequest.SCOPE_SESSION);
    }
}

From source file:com.bg.jtown.social.twitter.TweetAfterConnectInterceptor.java

public void postConnect(Connection<Twitter> connection, WebRequest request) {
    if (request.getAttribute(POST_TWEET_ATTRIBUTE, WebRequest.SCOPE_SESSION) != null) {
        try {/*w  w  w  .j  av a  2  s.  co  m*/
            //TODO updateStatus  
            connection.updateStatus("I've connected with the Mirros!");
        } catch (DuplicateStatusException e) {
        }
        request.removeAttribute(POST_TWEET_ATTRIBUTE, WebRequest.SCOPE_SESSION);
    }
}

From source file:rd.kpath.facebook.PostToWallAfterConnectInterceptor.java

public void postConnect(Connection<Facebook> connection, WebRequest request) {
    if (request.getAttribute(POST_TO_WALL_ATTRIBUTE, WebRequest.SCOPE_SESSION) != null) {
        try {/*from   w ww  .  j  a va 2 s .c  om*/
            connection.updateStatus("I've connected with the K-Path!");
        } catch (ApiException e) {
            // Do nothing: No need to break down if the post-connect post can't be made.
        }
        request.removeAttribute(POST_TO_WALL_ATTRIBUTE, WebRequest.SCOPE_SESSION);
    }
}

From source file:eu.gyza.eap.eapsocialontology.facebook.PostToWallAfterConnectInterceptor.java

public void postConnect(Connection<Facebook> connection, WebRequest request) {
    if (request.getAttribute(POST_TO_WALL_ATTRIBUTE, WebRequest.SCOPE_SESSION) != null) {
        try {/*from w  ww  .  j a  va  2s  . co m*/
            connection.updateStatus("I've connected with the EAP Social Ontology!");
        } catch (ApiException e) {
            // Do nothing: No need to break down if the post-connect post can't be made.
        }
        request.removeAttribute(POST_TO_WALL_ATTRIBUTE, WebRequest.SCOPE_SESSION);
    }
}