Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Form base authentication in Struts

 
Sandeep Ghosh
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7466
50
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic