我在 Spring Boot 中编写了一个自定义验证。自定义验证旨在检查两个字段是否匹配。一切正常,直到我尝试提交表格。繁荣我遇到了错误:
javax.validation.ConstraintViolationException: Validation failed for classes [com.joker.SampleAuthenticationWebApp.model.User] during persist time for groups [javax.validation.groups.Default, ]
List of constraint violations:[
ConstraintViolationImpl{interpolatedMessage='Passwords do not match!', propertyPath=con_password, rootBeanClass=class com.joker.SampleAuthenticationWebApp.model.User, messageTemplate='Passwords do not match!'}
]
Run Code Online (Sandbox Code Playgroud)
这个问题确实阻碍了我的学习进度。非常感谢您的帮助。
PS:我已经在寻找解决方案,但一切都无济于事。
注释:
package com.joker.SampleAuthenticationWebApp.validator;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;
@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = FieldsValueMatchValidator.class)
public @interface FieldsValueMatch {
String message() default "Fields values don't match!";
Class<?>[] groups() default {};
Class<? extends Payload>[] payload() default {};
String field();
String fieldMatch();
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME) …Run Code Online (Sandbox Code Playgroud) 美好的一天的人,我已经有几天这个问题了,当我尝试使用composer下载我的php项目的依赖项时我得到了这个错误
c:\wamp64\www\Test>composer global require "fxp/composer-asset-plugin:^1.3.1"
Changed current directory to C:/Users/Nwachukwu Favour/AppData/Roaming/Composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Installation failed, reverting ./composer.json to its original content.
[Composer\Downloader\TransportException]
The "http://packagist.org/p/provider-2014%241cf88bd0ed4076dc091407477ba2a76483e8598ee5365673381262e6c1d40fcf.jso
n" file could not be downloaded: failed to open stream: HTTP request failed!
require [--dev] [--prefer-source] [--prefer-dist] [--no-plugins] [--no-progress] [--no-update] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--] [<packages>]...
Run Code Online (Sandbox Code Playgroud)
我正在运行Windows 10操作系统,并怀疑我的系统无法从命令行下载.如果有人可以帮助我解决这个问题,我会很高兴,因为它阻碍了我的项目.提前致谢.