struts的数据校验.docVIP

  • 5
  • 0
  • 约6.19千字
  • 约 6页
  • 2016-06-12 发布于湖北
  • 举报
Struts的后台数据校验分为GenericValidator与Validator框架 public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { // TODO Auto-generated method stub ActionErrors errors=new ActionErrors(); if(GenericValidator.isBlankOrNull(username)){ ActionMessage error=new ActionMessage(errors.required,用户名); errors.add(username, error); } else if(!GenericValidator.matchRegexp(username, ^\\w+$)){ ActionMessage error=new ActionMessage(prompt.reg); errors.add(username, error); } if(GenericValidator.isBlankOrNull(pwd)){ ActionMessage error=new ActionMessage(errors.requ

文档评论(0)

1亿VIP精品文档

相关文档