我按照书(2004)中的教程进行操作JakataStruts live。我有代码片段:
@Override
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if(firstName == null || firstName.trim().equals("")){
errors.add("firstName", new ActionError("userRegistration.firstName.problem"));
}
//...
return errors;
Run Code Online (Sandbox Code Playgroud)
Netbeans IDE 注意到:“找不到符号”。如何解决上述问题呢?
类ActionError已被弃用。使用ActionMessage类别:
errors.add("firstName", new ActionMessage("userRegistration.firstName.problem"));
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2246 次 |
| 最近记录: |