• 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

logout in spring mvc

 
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have write the code for logout in the following to invalidate the session so that when we click on logout ot can't go back in the browser. i can't work with history javascript and also can't use spring security.
so please help me in the following code in redirecting to the login page


and write the controller like following


but the problem is my login page is out side WEB-INF and in the xml i have done the mapping like following as my all jsp pages are inside the WEB-INF and login page will be land page so i have kept that outside WEB-INF and inside web content folder.

\
<property name="prefix" value="/WEB-INF/JspPages/" />
<property name="suffix" value=".jsp" />


so when i am return login page how it will redirect to web content folder instead of WEB-INF
 
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is your login page? Is it .jsp? Is it .htm? or what?
 
Megha Singhal
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
its .jsp page
 
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have an LoginController mapped to url login.htm or something like this right?
Then, instead of returning the JSP page name, use RedirectView and redirect to login.htm..
 
H Paul
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When in doubt, ask for a clarification. (it won't hurt any body ), I'm a little slow.)

1. In terms of what(content) and where(location), you can post file name and its content and where the file reside?

For example:

WebContent\WEB-INF\ JspPages\*.jsp (all jsp pages)

2. Your Spring version?
 
it's a teeny, tiny, wafer thin ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic