Example #1
0
 /* 标签结束方法 */
 public int doEndTag() throws JspTagException {
   Object value = getEqObj();
   DataValidation d = (DataValidation) TF.getBean("system.vaildator");
   ValidModel model =
       new ValidModel()
           .setValue(value)
           .setCheckRule(this.checkRule)
           .setCheckType(this.checkType)
           .setMessage(this.message);
   try {
     String result = d.valid(model);
     if (result.equals("")) {
       return EVAL_PAGE;
     } else {
       printError(result);
       return SKIP_PAGE;
     }
   } catch (Exception e) {
     ARE.getLog().error("valid_error:校验出错-" + e.toString(), e);
     printError("校验出错");
     return SKIP_PAGE;
   } finally {
     clear();
   }
 }
Example #2
0
 private void printError(String result) {
   try {
     pageContext
         .getResponse()
         .getWriter()
         .print(new WebException("", result, "请检查提交参数").toString());
   } catch (IOException e) {
     ARE.getLog().error(e.toString(), e);
   }
 }