• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

[Spring] Obtain a session or request object

 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am trying to add some authentication to my application.
I have a Request interceptor which checks for the existance of a user in the session, if its there it is ok, otherwise it redirects to the logon page.

When a user hist the logon page, the username and password field are valdiated using a validator to ensure there is a user name and password, this is then passed on to the logonControls doSubmitAction.

At this point I wish to authenticate the user and add it to the session.


Even using the onSubmitAction, I cant actual get either a session object or request object.

By this point I am guessing the request object is invalid anyway. But even from the applicationContext I seem to be unabel to find a method to return me a session.

Is it possible to chose which pages an interceptor will affect? I am thinking perhaps some pages will help with access levels/permissions.

Thanks
G
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What implementation of Controller are you using? SimpleFormController? If you are using SimpleFormController, then just override

 
Gavin Tranter
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jason,
Thanks, I feel very dumb. There are two SimpleFormControls listed in the API docs, one (the one I was reading) didnt have onSubmit.

Doh! one is the portlet versions!

Thank you for saving my from my own stupidity.

G
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No problem, glad I could help.
 
No more fooling around. Read this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!