I want all my Actions to extend BaseAction.

In BaseAction I want to check user session and to put some data in it, if that data 
doesn't exist.

Is it good way:

public class SomeAction extends BaseAction {
  public ActionForward execute( ActionMapping mapping,
                                ActionForm form,
                                HttpServletRequest request,
                                HttpServletResponse response ) {
  super.execute( mapping,form, request, response);
  OK, proceed ...........


public class BaseAction extends BaseAction {
  public ActionForward execute( ActionMapping mapping,
                                ActionForm form,
                                HttpServletRequest request,
                                HttpServletResponse response ) {
  if (userSession is wrong) {
    -try   -- put data in session
    -catch -- return mapping.findForward("wrongSession");}
  else return null;  //everything is OK

What you think about this way and is there better way to extend Action?

Thanks.

Reply via email to