Example usage for javax.servlet.http HttpSession removeAttribute

List of usage examples for javax.servlet.http HttpSession removeAttribute

Introduction

In this page you can find the example usage for javax.servlet.http HttpSession removeAttribute.

Prototype

public void removeAttribute(String name);

Source Link

Document

Removes the object bound with the specified name from this session.

Usage

From source file:br.com.arduinoweb.controller.UserController.java

@RequestMapping("/")
public String Login(HttpSession session) {
    session.removeAttribute("usuarioLogado");
    return "redirect:/Login";
}

From source file:edu.chalmers.dat076.moviefinder.controller.LoginController.java

@RequestMapping(value = "/logout", method = RequestMethod.POST)
@ResponseStatus(value = HttpStatus.OK)/*from   w  w  w .  ja  v  a  2  s.  c o  m*/
public void logout(HttpSession s) {
    s.removeAttribute("user");
}

From source file:org.freeeed.search.web.controller.LogoutController.java

@Override
public ModelAndView execute() {
    log.debug("Logout called!");

    HttpSession session = request.getSession();
    session.removeAttribute(WebConstants.LOGGED_SITE_VISITOR_SESSION_KEY);

    this.loggedSiteVisitor = null;

    return new ModelAndView(WebConstants.LOGOUT_PAGE);
}

From source file:controller.logout.java

@Override
public ModelAndView handleRequest(HttpServletRequest hsr, HttpServletResponse hsr1) throws Exception {

    ModelAndView m = new ModelAndView("logout");
    HttpSession session = hsr.getSession();
    session.removeAttribute("scard");
    // m.addObject("doctors", list);
    m.getViewName();/*from   w  w w  .j a  v a2  s .  c o m*/

    return new ModelAndView(new RedirectView("home.htm"));

}

From source file:dicky.controlleruser.AccountController.java

@RequestMapping(value = "logout", method = RequestMethod.GET)
public String logout(HttpSession session) {
    session.removeAttribute("username");
    return "redirect:/account/myaccount.html";
}

From source file:edu.ijse.tcd.controller.LogInController.java

@RequestMapping(value = "logout", method = RequestMethod.GET)
public String logout(ModelMap map, HttpServletRequest request) {
    HttpSession hs = request.getSession();
    hs.removeAttribute("user");
    return "login";
}

From source file:com.esd.ps.IndexController.java

/**
 * ?//  ww w  . j  av a2 s  .  co  m
 * 
 * @return
 */
@RequestMapping(value = "/quit1", method = RequestMethod.GET)
public ModelAndView quitGet(HttpSession session) {
    session.removeAttribute(Constants.USER_ID);
    return new ModelAndView("login");
}

From source file:ilearn.orb.controller.LogInOutController.java

@RequestMapping(value = "/logout")
public ModelAndView logout(HttpSession session) {
    session.removeAttribute("auth");
    session.removeAttribute("username");
    session.removeAttribute("id");
    ModelAndView model = new ModelAndView();
    model.setViewName("logout");
    return model;
}

From source file:th.co.geniustree.osgi.prototype.authen.security.AuthenSuccessHandlerImpl.java

@Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
        Authentication authentication) throws IOException, ServletException {
    HttpSession session = request.getSession();
    session.removeAttribute(WebAttributes.AUTHENTICATION_EXCEPTION);
    store.storeAuthentication(session, authentication);
    strategy.sendRedirect(request, response, getRedirectUrl(request));
}

From source file:net.groupbuy.service.impl.RSAServiceImpl.java

@Transactional(readOnly = true)
public void removePrivateKey(HttpServletRequest request) {
    Assert.notNull(request);//from w  ww.j  ava2s . com
    HttpSession session = request.getSession();
    session.removeAttribute(PRIVATE_KEY_ATTRIBUTE_NAME);
}