• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

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.


     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    reply
      Bookmark Topic Watch Topic
    • New Topic