Hi,
I believe supporting a getSession() call is useful in the Action class.

let me walk you through a situation:

public class MyAppBaseAction extends DispatchAction
{
     //some helper functions

     isAuthorized( arguments )
     {


     }

}


public class MyAction1 extends MyAppBaseAction
{

      create(....)
      {
              isAuthorized(...)

              //restOfCode....

       }

}



Now in the above scenario... isAuthorized necessarily needs to be sent a
request object as one of the parameters from which it can extract the
session and then extract the user object from the session. This is not a
great pain, but I think the code would look cleaner if I dont have to pass
the request/session object around. If I had a getSession function support
from the struts action class, then isAuthorized doesnt need to have an
argument like Session or Request.

What do you think?

Regards,
Raghu

Reply via email to