• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Is Session needed for my use case in spring mvc ?

 
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It might seem a silly question, but then

my application have controllers and didn't have any login so far, now i need to have login.

my doubt is regarding ..after login..should i have some attribute in the session that captures if the user is logged in or not?

And also should use a filter/interceptor for checking if the user is logged in

if user tries to hit the direct requestmapping urls..

Regards
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes if you need to login you will need a session, unless you want your users to have to log in again every request they make

Servlet Filters are a good choice for handling authentication. Luckily Spring Security has done most of this work for you, so if you are already using Spring look at using Spring Security to handle this for you.
http://projects.spring.io/spring-security/

 
reply
    Bookmark Topic Watch Topic
  • New Topic