Hi, My form extends ValidationForm, and of course i have got validator-rules and validation.xml. But when i want to make a custom valition in validate() method , i took "javax.servlet.jsp.JspException: Cannot find bean error in any scope "
My jsp page includes the code below to show the errors: ************************************* <logic:messagesPresent> <UL> <html:messages id="error"> <LI><bean:write name="error"/></LI> </html:messages> </UL> </logic:messagesPresent> ************************************* overriding validate() method ************************************************************************ * public ActionErrors validate(ActionMapping mapping, javax.servlet.http.HttpServletRequest request) { ActionErrors errors = null ; errors = super.validate(mapping,request); try { if (errors == null) { errors = new ActionErrors(); } Calendar c1 = dUtils.str2Calendar(startdate); Calendar c2 = dUtils.str2Calendar(enddate); // if enddate bigger then startdate then add error if ( !c1.before(c2) ) { // custom validation errors.add(ActionErrors.GLOBAL_ERROR ,new ActionError("errors.dateerror","test"); } // print out the errors Iterator it = errors.get(); while ( it.hasNext() ) { ActionError ae = (ActionError) it.next(); System.out.println("Errors : " + ae.getKey() + " " ); int length = ae.getValues().length; Object[] o = ae.getValues(); for (int i=0; i<length ; i++) { System.out.println(" : " + o[i] + " " ); } System.out.println("************************************" ); } } catch ( Exception ex ) { System.out.println("Ex: " + ex); } finally { if (errors.isEmpty()) { return null; } return (errors); } } ************************************************************************ * Any idea ? Regards