FileDocCategorySizeDatePackage
Ch10_04.javaAPI DocExample1396Mon Dec 01 15:08:26 GMT 2003org.eclipsebook.ch10

Ch10_04

public class Ch10_04 extends Action

Fields Summary
Constructors Summary
Methods Summary
public ActionForwardexecute(ActionMapping mapping, ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)


        ActionErrors actionerrors = new ActionErrors();
                
        Ch10_06 orderForm = (Ch10_06)form;
        
        String email = orderForm.getEmail();        
        if(email.trim().equals("")) {
            actionerrors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.noemail"));
        }
        
        String type = orderForm.getType();        
        if(type.trim().equals("")) {
            actionerrors.add("ActionErrors.GLOBAL_ERROR", new ActionError("error.notype"));
        }
        
        String[] items = orderForm.getItems();        
        if(items == null) {
            actionerrors.add("ActionErrors.GLOBAL_ERROR", new ActionError("error.noitems"));
        }
            
        if(actionerrors.size() != 0) {            
            saveErrors(request, actionerrors);
            return new ActionForward(mapping.getInput());            
        }

        return mapping.findForward("OK");