Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring 胸腺素输入验证_Spring_Forms_Spring Boot_Thymeleaf - Fatal编程技术网

Spring 胸腺素输入验证

Spring 胸腺素输入验证,spring,forms,spring-boot,thymeleaf,Spring,Forms,Spring Boot,Thymeleaf,我正在使用SpringBoot+Thymeleaf构建一个web应用程序,并在表单输入中添加了验证。 有没有一种方法可以不用类,只使用网页中的Thymeleaf语法进行验证(就像javascript一样)?我认为你不能用Thymeleaf自己进行验证,没有。Thymeleaf不是为这个目的构建的。你可以使用'pattern'html属性使用正则表达式进行验证,或者如果需要更多的话,可以添加javascript。

我正在使用SpringBoot+Thymeleaf构建一个web应用程序,并在表单输入中添加了验证。
有没有一种方法可以不用类,只使用网页中的Thymeleaf语法进行验证(就像javascript一样)?

我认为你不能用Thymeleaf自己进行验证,没有。Thymeleaf不是为这个目的构建的。你可以使用'pattern'html属性使用正则表达式进行验证,或者如果需要更多的话,可以添加javascript。