aspose file tools
The moose likes Spring and the fly likes Spring Security - Custom logout page  Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Reply Bookmark "Spring Security - Custom logout page  " Watch "Spring Security - Custom logout page  " New topic
Author

Spring Security - Custom logout page

ahmed yehia
Ranch Hand

Joined: Apr 22, 2006
Posts: 424
Spring Security logout links to 'j_spring_security_logout' by default, I want to link to logout.jsp instead.

E.g. in logout.jsp :
  • <jsp:forward page="j_spring_security_logout" />
  • <% response.sendRedirect("j_spring_security_logout"); %>
  • <% session.invalidate(); %>


  • These all seem to work identical as firing a logout action.

    However which could a be better approach.
    Freddy Wong
    Ranch Hand

    Joined: Sep 11, 2006
    Posts: 959

    You still need to send the request to j_spring_security_logout, but then you can add logout-success-url to redirect it to your logout.jsp


    SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
    My Blog
    ahmed yehia
    Ranch Hand

    Joined: Apr 22, 2006
    Posts: 424
    I have this in applicationContext-security xml file :


    It works fine whether the request came through forward or redirect.

    Just want to make sure these 2 approaches don't vary.


     
    I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
     
    subject: Spring Security - Custom logout page
     
    Similar Threads
    AccessDeniedException not going to accessDenied.xhtml
    jsp logout problem
    AccessDeniedExceptionHandler handle method never called
    Error: The matching wildcard is strict, but no declaration can be found for element 'remember-me'
    No AuthenticationEntryPoint could be established