Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

j_security_check, Please help.

 
Justin Fluff
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do i call this action programatically? I already have a login method in my action class, I wanna call this from there.

Please help asap.'j_security_check'
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need to tell us which app server you're using, some of them behave slightly differently.
The short answer is that you need to set up 'declarative security' in your web application by changing settings in your web.xml
 
Pavel Cherkashin
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be this will help you.
 
Thomas Hubschman
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

To echo what David said, Web App containers (Tomcat and others) use a form of security called 'declaritive security.' What this means is that you 'declare' a web resource (servlet or jsp) to be inside your security perimeter usally in web.xml.
If an unauthenticated or unauthorized (two different things) user attempts to access that page (by clicking a link or typing in their URL bar) they get redirected to your login page or a login window pops up. After sucessful login they get forwarded to the original requested resource.

I hope that helps. I attached the code from the web.xml for the project I am currently working on.



I hope that is helpful.

Tom
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic