aspose file tools*
The moose likes Struts and the fly likes Form base authentication in Struts 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 "Form base authentication in Struts" Watch "Form base authentication in Struts" New topic
Author

Form base authentication in Struts

Sandeep Ghosh
Ranch Hand

Joined: Jan 23, 2002
Posts: 145
Hi Friends,
I am new to Struts framework. I am trying to use form base authentication in struts .If user is in role Admin then admin.jsp will be shown else user.jsp . Do I have to extend ActionServlet and use request.isUserInRole/(admin/) for this purpose or it could be done in some other way.
Please help me immediately as I have already spent 2 days for finding solution myself.
Sonu
[ December 19, 2002: Message edited by: Sonu Ghosh ]
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4757
    
    7

Originally posted by Sonu Ghosh:
Please help me immediately as I have already spent 2 days for finding solution myself.

Sonu,
I know you must be frustrated and desperate right now; we've all been through this sort of thing at one time or another. That being said, however, you should try to avoid using the words "urgent" and "immediately" in forums like this as it sometimes has the opposite effect.
You're in luck today though, JavaRanch being a friendly place for greenhorns, so I will tell you what I have done in the past:
I define forwards for my logon.do that have the same names as my user roles. That means if I have an "admin" user role, I have an "admin" forward that points to the adminhome.jsp. I do the same for other user roles. Once I determine what role the user has, then I simply use it as the argument to mapping.findForward().
HTH


Junilu - [How to Ask Questions] [How to Answer Questions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Form base authentication in Struts