SpringBoot
Spring Boot のアプリで Maven を使っていたところ、pom.xml の dependency/version で警告が出ました。 これから、その詳細と解決方法を書いていきます。 バージョン Spring Boot 2.7.5 事象 以下の version に警告マークが付きました。 <project> ... <dependencies> <dependency> <groupId>org.project</groupid></dependency></dependencies></project>…
Spring Boot のアプリから H2 データベースに接続して、ブラウザで H2 コンソールを使用する方法を書いていきます。 バージョン Spring Boot 2.7.5 1. Spring Boot の H2 自動設定について Spring Boot は、アプリが以下の条件を満たすと、H2 Console を使え…
Spring Boot で、サービスクラスを使う方法を書いていきます。 1. サービスクラスを使う方法 サービスクラスを作成して、@Service のアノテーションを付けます。 2. アノテーションの効果 サービスクラスにアノテーションを付けると、Spring Boot がオブジェ…
Spring の MessageSource を使って、メッセージをプロパティファイルから取得する方法を書いていきます。 バージョン SpringBoot 2.7.5 目次 プロパティファイルの作成 Java コードの作成 動作確認 国際化・多言語対応 複数のプロパティファイルに対応 1. プ…
Spring Boot の @Autowired のエラー(DI したいクラスが見つからない)を解決する方法を書いていきます。 バージョン Spring Boot 2.7.5 目次 エラーの例 1.1. コード 1.2. エラー内容 解決方法 2.1. サービスクラスの場合 2.2. リポジトリの場合 2.3. 他の…