wood burning stoves 2.0*
The moose likes Struts and the fly likes j_security_check or login.do Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "j_security_check or login.do" Watch "j_security_check or login.do" New topic
Author

j_security_check or login.do

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="login.do">

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
Kalle
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.


Merrill
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: j_security_check or login.do