I have extended the LookupDispatchAction in order to manage several
submit buttons in my JSP.

         I have several JSP pages in my application that have the same look:
             a table with multiple buttons. On each page we find common
buttons (go to, customize, 
             select all/unselect all) and specific buttons. 
         
         I would like to know if I must declare a class
BaseLookupDispatchAction 
        (this class will implement common buttons, is it possible ?) and a
        x_SpecificLookupAction  for each page that will extend
BaseLookupDispatchAction 
        in order to implement the specific buttons.

        I am not sure that is possible and the best way to do the thinks.

        For the moment I have only one Action that manage submit buttons

        public class BaseLookupDispatchAction extends LookupDispatchAction 
        {
  
                public BaseLookupDispatchAction () 
                  {
   
                  }
  
  
                public ActionForward execute(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception 
                  {
                      if ( request.getParameter( mapping.getParameter() ) ==
null ) {
                        return (
mapping.findForward(Constants.s_FAILURE_KEY) );
                       } else {
                            return super.execute( mapping, form, request,
response );
                  }   

                 protected Map getKeyMethodMap() 
                  {
                     Map map = new HashMap();
                     // Common to several pages
                     map.put("button.customise", "Customise" );
                     map.put("button.goId","Go");
                     return map;   
                  }

                   public ActionForward Customise(ActionMapping mapping,
ActionForm form, HttpServletRequest
request, HttpServletResponse response) throws Exception 
                   {
                     return null;   
                   }

                   public ActionForward Go(ActionMapping mapping, ActionForm
form, HttpServletRequest
request, HttpServletResponse response) throws Exception 
                   {
                     return null;   
                   }

        }

        For each page, the content of the method getKeyMethodMap has to be
extended in order to add methods
            specific to each page.

        thank you in advance for your examples and your help.
        Sandra 

  


----------------------------------------------------------------------------

As of February 12th, 2003 Thomson unifies its email addresses on a worldwide
basis. 
Please note my new email address: [EMAIL PROTECTED] 

http://www.thomson.net/ 

Reply via email to