aspose file tools*
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 Spring in Action this week in the Spring 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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: j_security_check or login.do