0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Spring BootでBean Validationを有効にする

Posted at

環境

Mac OS Big Sur
Apache Maven
Spring Boot 2.4.2

状況

Bean Validationを使うために@NotNull, @Sizeアノテーションを記述したが、正しくインポートされない。
スクリーンショット 2021-02-16 15.23.19.png

解決策

ビルドパスが通っていないことが原因のためpom.xmlに以下の内容を追記

<dependency>
    <groupId>org.glassfish</groupId>
    <artifactId>javax.el</artifactId>
    <version>3.0.1-b09</version>
 </dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-validation</artifactId>
</dependency>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?