今天在復習Struts時,才發現在Struts1.1版本以前,對ActionForm的validate方法調用時,ActionErrors的里面只能這樣寫:
ActionErrors error = new ActionErrors();
error.add("name",new ActionErrors("reg.error.name.missing"));
在1.2時面就可以使用:
error.add("name",new ActionMessage("reg.error.name.missing"));
當時我沒注意版本,所以就不停出錯!呵呵!