问题是我需要在客户端验证中将此类中文输入视为无效:
任何与任何中文字符和空格混合的英文字符总长度> = 10时,输入无效.
让我们说:"你的是你的你的你"或"你的你的你的你"(长度为10)无效.但是"你的是你的一个人"(长度为9)是可以的.
我使用Javascript进行客户端验证,使用Java进行服务器端.所以我认为在两者上应用正则表达式应该是完美的.
任何人都可以提供一些提示如何在正则表达式中编写规则?
我使用自定义注释为我的 spring boot 控制器注释了一些功能,以用于记录目的。但是,我发现对于嵌套方法,before 建议会执行两次。在这里寻找一些想法。请参考下面的代码片段。
控制器
@RequestMapping(value = "apply")
@OperationMILog
public ApplyHttpResponse apply(@RequestHeader final String custId, @RequestAttribute final String cardNo,
@RequestBody final InstallmentApplyHttpRequest installApplyReq, @PathVariable final String source) {
//test
this.test(); //**line 387**
...
}
....
@OperationMILog
private String test() {
return this.test1(); //**line 593**
}
@OperationMILog
private String test1() {
return "test1";
}
Run Code Online (Sandbox Code Playgroud)
注释
@Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface OperationMILog {
}
Run Code Online (Sandbox Code Playgroud)
方面
@Aspect
public class GenericLoggingAspect {
public static GenericLoggingAspect genericLoggingAspect;
@PostConstruct
public void init() { …Run Code Online (Sandbox Code Playgroud)