# jfinal-annotation **Repository Path**: ren365880/jfinal-annotation ## Basic Information - **Project Name**: jfinal-annotation - **Description**: jfinal参数不能为空的注解,可根据源码自己扩展 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2017-10-23 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: utils **Tags**: None ## README # jfinal-annotation jfinal参数不能为空的注解,可根据源码自己扩展 1.使用 Annotation.java 和 EmptyInterceptor.java两个文件 2.在路由设置里添加addInterceptor(new EmptyInterceptor()); 3.在控制器的方法上@Annotation({"参数名","参数名","参数名"}) 或者 @Annotation("参数名") 比新建class继承Validator去写文件方便很多 如果要其他的验证,丰富 ``` for (String v : value) { String parameter = con.getPara(v); if (parameter == null || parameter.trim().length() == 0) { isTrue = false; key = v; break; } } ``` 就可以