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 ]
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