1600 PMP mock questions 1400 CAPM mock questions 800 SCJP 6 mock questions 600 OCAJP 7 mock questions 590 OCPJP 7 mock questions 556 SCWCD 5 mock questions 500 OCEJWCD 6 mock questions pdfDownload (java,struts, hibernet etc)
Java online test
JSP online test
ORACLE online test
Hibernate online test
Servlet online test
Struts online test
EJB online test
C online test
C++ online test
Aptitude online test

How does reset() and Validate() method struts work ?

reset(): reset() method is called by Struts Framework with each request that uses the defined ActionForm. The purpose of this method is to reset all of the ActionForm's data members prior to the new request values being set.
Example:
/**
         * Reset the form.
         */
        public void reset(ActionMapping mapping, HttpServletRequest request) {
            
            super.reset(mapping,request);
         this.password = null;
         this.username = null;
         this.guest = null;
        }

validate() : Used to validate properties after they have been populated; Called before FormBean is handed to Action. Returns a collection of ActionError as ActionErrors. Following is the method signature for the validate() method.

Example :
/**
         * Validate the form's input.
         */
        public ActionErrors validate(ActionMapping mapping,
                HttpServletRequest request) {
                        
            ActionErrors errors = new ActionErrors();

if(username == null){
                    errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.username.required"));
                }
return errors;
}

Online Practice Test

Java online test
JSP online test
ORACLE online test
Hibernate online test
Servlet online test
Struts online test
EJB online test
C online test
C++ online test
Aptitude online test

Reviews and Comments


PMP, CAPM, PMI is a registered certification mark of the Project Management Institute, Inc

Copyright © www.techfaq360.com 2016


About US | Contact US | Privacy Policy | Terms and Conditions  | Website disclaimer  | Cancellation and Refund Policy  | Shipping & Delivery Policy