Package javax.servlet.http

Examples of javax.servlet.http.HttpServletRequest.logout()


    public void logout() throws Exception {
        TestingAuthenticationToken expectedAuth = new TestingAuthenticationToken("user", "password","ROLE_USER");
        SecurityContextHolder.getContext().setAuthentication(expectedAuth);

        HttpServletRequest wrappedRequest = wrappedRequest();
        wrappedRequest.logout();

        verify(logoutHandler).logout(wrappedRequest, response, expectedAuth);
        verifyZeroInteractions(authenticationManager, logoutHandler);
        verify(request, times(0)).logout();
    }
View Full Code Here


        HttpServletRequest request = ServletActionContext.getRequest();
        HttpServletResponse response = ServletActionContext.getResponse();
        HttpSession session = request.getSession();
       
        try {
            request.logout();
        } catch(ServletException se) {
            request.setAttribute("authenticationMessage", "Logout failed.");
            Logger.getLogger(actions.LogoutAction.class.getName()).log(Level.INFO, "Logout attempt failed");
            return("fail");  
        }
View Full Code Here

    public String logout() {
        loggedIn = false;
        final FacesContext context = FacesContext.getCurrentInstance();
        final HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();
        try {
            request.logout();
            context.getExternalContext().invalidateSession();
        } catch (ServletException e) {
            logger.error("Ошибка выхода из системы", e);
        }
        return "index";
View Full Code Here

      // This handles the situations where ws-security was enabled, but has currently been disabled for the consumer
      else if (request.getRemoteUser() != null)
      {
         try
         {
            request.logout();
         }
         catch (ServletException e)
         {
            //FIXME
            e.printStackTrace();
View Full Code Here

  {
    ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
    HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();
    try
    {
      request.logout();
    }
    catch (ServletException servletEx)
    {
      logger.warn("Failed to logout the user", servletEx);
    }
View Full Code Here

      FacesMessage facesMessage = new FacesMessage(FacesMessage.SEVERITY_INFO, message, null);
      context.addMessage(null, facesMessage);
      result = "/Index.xhtml?faces-redirect=true";
      ExternalContext externalContext = context.getExternalContext();
      HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();
      request.logout();
    }
    catch (UserException userEx)
    {
      String key = "AccountPreferences.InternalDeleteErrorMessage";
      logger.error(Messages.getLoggerString(key), userEx);
View Full Code Here

        
        FacesContext context = FacesContext.getCurrentInstance();
        HttpServletRequest request = (HttpServletRequest)context.getExternalContext().getRequest();
        
        try {
          request.logout();
        } catch (ServletException e) {
         
          result = "failedlogin?faces-redirect=true";
        }
        
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.