我的addressform中validate()的部分代码
if(username==null||username.equals("")){
errors.add("username", new ActionMessage("address.error.username"));
}
jsp页面 <tr><td>
username :
</td>
<td>
<html:text property="username"/>
<html:errors property="username"/>
</td></tr>
当我不输入username时提交表单,为什么不提示错误信息呢,其他配置没错,就是想问下address.error.username这个一定要写到ApplicationResources.preperties文件中吗,我没写进去,如果不写进去是不是就不能显示出来错误信息呀,我想在jsp页面显示"用户名不能为空",该怎么写
if(username==null||username.equals("")){
errors.add("username", new ActionMessage("address.error.username"));
}
jsp页面 <tr><td>
username :
</td>
<td>
<html:text property="username"/>
<html:errors property="username"/>
</td></tr>
当我不输入username时提交表单,为什么不提示错误信息呢,其他配置没错,就是想问下address.error.username这个一定要写到ApplicationResources.preperties文件中吗,我没写进去,如果不写进去是不是就不能显示出来错误信息呀,我想在jsp页面显示"用户名不能为空",该怎么写
errors.add("username", new ActionMessage("用户名不能为空", false));
2的哪儿有这个API呀