Re: best possible design

2007-01-30 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Maya,

Maya menon wrote:
> I need to enable role based access to my Struts-J2EE application. ie,
> if a normal user logs in, user should see one page whereas if a
> superuser logs in he should see another page.

IU'm not sure about "best possible" design, but I have one that's
relatively simple and easy to understand.

The home page for my struts application is /user/home.do. This is mapped
to a simple action that checks the user's primary role (which is
available through a special User object that I keep in the user's
session). I simply execute this code:

return mapping.findForward(user.getPrimaryRole());

Then, in my struct-config.xml file, I have something like this:







Straightforward to read, and easy to implement.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFv6pa9CaO5/Lv0PARAussAJ9XpJdhYyk6RYHGuygCd/SZ3G6VUQCcChXn
T2AECKaRT9O17mPdwg58bIw=
=FK32
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



best possible design

2007-01-30 Thread Maya menon
All,
   
  I need to enable role based access to my Struts-J2EE application.
  ie, if a normal user logs in, user should see one page whereas if a superuser 
logs in he should see another page.
   
  Whats the best suited design here ?
  Any links ?
   
  I use Struts 1.x,Eclipse and Tomcat
   
  Thank You

 
-
It's here! Your new message!
Get new email alerts with the free Yahoo! Toolbar.