This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Struts and the fly likes j_security_check or Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "j_security_check or" Watch "j_security_check or" New topic

j_security_check or

Kalle Anka
Ranch Hand

Joined: Jul 06, 2005
Posts: 69
I'm quite new at Struts and J2EE. This is a problem im faced with now.
i'm trying to get a "login" and "register" functionality working togheter with Struts.

<form action="j_security_check"> is the way I have learned earlier for container based authentications. However I would like to make this go through a Struts action... like <form action="">

Is there any way to from within the Struts action call the container based authorization (j_security_check)? Do u suggest any other solutions?

best wishes
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
My suggestion would be to keep your login form as a regular, non-struts jsp and register it in the web.xml file, just as you do with your non-struts applications. Once the user is authenticated, you can use the J2EE security APIs within your action class to verify roles, etc.

When you write a struts application, not every page has to use struts html tags.

Consultant, Sima Solutions
Kalle Anka
Ranch Hand

Joined: Jul 06, 2005
Posts: 69
thanks Merrill,

I was thinking about that solution. But doesnt you loose alot of the strengths of Struts if doing so: like single point of entry and maintaince.

It just seem so strange that Struts creators havnt thought of integrating the j2ee authentication with Struts.
Don't get me started about those stupid light bulbs.
subject: j_security_check or
It's not a secret anymore!