4.struts2中,actionerror与fielderror的区别
(1).actionerror里面加入的为错误信息,为一个集合
fielderror里面加入的为一个键值对,为一个map
this.addFieldError("birthday","birthday should be before gradution");
this.addActionError("birthday should be before gradution");
(2).在struts标签中,能自动显示fielderror中的错误,根据map里面的key找到错误信息
actionerror显示不出来,需在jsp页面上加上<s:actionerror/>
(3).如果不想显示struts自带的类型转换错误,可以将form的表单的theme设置为simple,这时
struts表单就完成了一个html表单
<s:form action="register" theme="simple">