1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
...
private String heureSoumission[];
...
/**
* Method validate
* @param ActionMapping mapping
* @param HttpServletRequest request
* @return ActionErrors
*/
public ActionErrors validate(
ActionMapping mapping,
HttpServletRequest request)
{
ActionErrors errors = new ActionErrors();
if (heureSoumission != null)
{
for (int i=0; i<heureSoumission.length; i++)
{ if (heureSoumission[i] == null || heureSoumission[i].trim().equals(""))
{ errors.add("global",new ActionError("heure.envoi.obligatoire"));
break;
}
else
if (!DateUtil.controleValideFormatHeure(heureSoumission[i], Const.REGEXP_FORMAT_HEURE))
{ errors.add("global",new ActionError("heure.envoi.format.invalide",Const.HEURE_HH_MM_SS));
break;
}
}
}
return errors;
}
...
/**
* @return the heureSoumission
*/
public String[] getHeureSoumission() {
return heureSoumission;
}
/**
* @param heureSoumission the heureSoumission to set
*/
public void setHeureSoumission(String[] heureSoumission) {
this.heureSoumission = heureSoumission;
} |
Partager