Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spring Security - Custom logout page

 
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
     
    Ranch Hand
    Posts: 959
    Eclipse IDE Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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
     
    ahmed yehia
    Ranch Hand
    Posts: 424
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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.


     
    Consider Paul's rocket mass heater.
    reply
      Bookmark Topic Watch Topic
    • New Topic