我想验证application.properties
中的值。我使用@Value注入,并使用@NotBlank验证用@Configuration
注释的类中的方法参数。
createSslContext( @Value("#{systemProperties['javax.net.ssl.trustStore']}") @NotBlank(message = "Truststore is needed") String path)
我已包含
hibernate-validator
和hibernate-validator-annotation-processor
属性。使用Spring 2.2.0.RELEASE。
这不起作用。该值已注入,但未经验证。我想念什么?
我想验证application.properties中的值。我使用@Value注入,并使用@NotBlank验证用@Configuration注释的类中的方法参数。 createSslContext(...
将@Validated
添加到您的配置类。