When to forward to an action and when to forward to a JSP.

As far as I know when some action need to done then forwad to action otherwise to JSP.

I am working on a jsp in which there are two tables.
In the second table the user can check the customers he want to move to the first table and press a button to move them to the first table.

Have a dispath method on the button which is removing the customers from the arraylist of second and adding to the first.

   public ActionForward addCustomers(ActionMapping mapping,
         ActionForm form,
         HttpServletRequest request,
         HttpServletResponse response)
         throws IOException, ServletException {
       // do Add Customers To Eligibility
       DynaActionForm frm = (DynaActionForm) form;

       String[] selCustList = (String[])frm.get("selectedCustomers");

       for(int i = 0; i < selCustList.length; i++){
           String selCust = (String)selCustList[i];


           //Remove the selected Customer from the non customers List
           ArrayList nonCusts = (ArrayList)frm.get("nonCustomers");
           if( nonCusts.contains(seCust) ) {
               nonCusts.remove(selCust);
           }

           //Add the selected customer to the customers List
           ((ArrayList)frm.get("Customers")).add(selCust);
       }

       return mapping.findForward("successAddCustomers");
   }

i.e Just updating the ArrayList that are in the form which scope is session.

In action mapping can I just forward it to the jsp?

Thanks.



Thanks.

_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/


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

Reply via email to