今天在復(fù)習(xí)Struts時(shí),才發(fā)現(xiàn)在Struts1.1版本以前,對(duì)ActionForm的validate方法調(diào)用時(shí),ActionErrors的里面只能這樣寫:
ActionErrors error = new ActionErrors();
error.add("name",new ActionErrors("reg.error.name.missing"));
在1.2時(shí)面就可以使用:
error.add("name",new ActionMessage("reg.error.name.missing"));
當(dāng)時(shí)我沒(méi)注意版本,所以就不停出錯(cuò)!呵呵!
ActionErrors error = new ActionErrors();
error.add("name",new ActionErrors("reg.error.name.missing"));
在1.2時(shí)面就可以使用:
error.add("name",new ActionMessage("reg.error.name.missing"));
當(dāng)時(shí)我沒(méi)注意版本,所以就不停出錯(cuò)!呵呵!