aspose file tools*
The moose likes Servlets and the fly likes j_security_check, Please help. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "j_security_check, Please help." Watch "j_security_check, Please help." New topic
Author

j_security_check, Please help.

Justin Fluff
Greenhorn

Joined: Apr 03, 2005
Posts: 2
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

Joined: Mar 06, 2001
Posts: 13459

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

Joined: Mar 04, 2005
Posts: 47
May be this will help you.


Pavel Cherkashin - <br />SCJP, SCWCD, SCDJWS, SCBCD, SCEA, ...<br />www.linkedin.com/in/pcherkas
Thomas Hubschman
Ranch Hand

Joined: Sep 25, 2002
Posts: 88
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


SCJP '02, SCWCD '02, SCJD '08, SCSNB '09, SCEA '10
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: j_security_check, Please help.