1 20 21 package com.methodhead.aikp; 22 23 import javax.servlet.http.HttpServletRequest ; 24 25 import org.apache.struts.action.ActionErrors; 26 import org.apache.struts.action.ActionMapping; 27 28 import org.apache.struts.validator.DynaValidatorForm; 29 import org.apache.commons.lang.StringUtils; 30 31 public class AikpForm extends DynaValidatorForm { 32 33 35 37 39 41 47 public ActionErrors validate( 48 ActionMapping mapping, 49 HttpServletRequest request ) { 50 51 if ( ( "save".equals( get( "action" ) ) || 52 "saveNew".equals( get( "action" ) ) ) && 53 ( StringUtils.isBlank( ( String )get( "delete" ) ) && 54 StringUtils.isBlank( ( String )get( "cancel" ) ) ) ) 55 return doValidate( mapping, request, super.validate( mapping, request ) ); 56 57 return new ActionErrors(); 58 } 59 60 65 public ActionErrors doValidate( 66 ActionMapping mapping, 67 HttpServletRequest request, 68 ActionErrors errors ) { 69 70 return errors; 71 } 72 73 75 } 77 | Popular Tags |