本文へスキップ
製品デスクトップツールTASTECAD図面の確認TASTEFILESファイル管理TASTEFTPファイル転送TASTESSHリモートワークスペースTASTEZIP圧縮と展開TASTEWINMファイル管理開発ツールTASTECODERust 統合開発環境TASTESTUDIO統合開発・テスト環境TASTEETLデータ統合(ETL)サーバーTASTEREMOTEリモートデスクトップサーバーTASTEGEO空間情報サーバーTASTEMAILメールワークスペース投資TASTESTOCK株式自動売買デスクトップアプリはじめるダウンロードドキュメント購入すべての製品
マーケットプレイス
ニュース
技術ニュース今日の開発ニュース開発ドキュメントプログラミング言語RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWebフロントエンド フレームワークNext.jsReactVue.js · NuxtSvelteKitAngularサーバー フレームワークSpring BootDjangoFastAPIASP.NET CoreNestJS · Expressアプリ・デスクトップ フレームワークTauriFlutterReact NativeElectronアルゴリズムアルゴリズムの基礎主要アルゴリズム発展アルゴリズム実務のアルゴリズム
コミュニティプロジェクト開発ログプロンプトAIツールの問題ショーケースコミュニティガイド
協業技術移転ウェブサイト構築デスクトップアプリ構築リリース・決済パイプライン販売パートナーお問い合わせ
サービスリモートデスクトップインストールパッケージのカスタマイズ
TASTEDEV
製品

デスクトップツール

TASTECAD複雑な図面を、軽やかにひらくTASTEFILES必要なファイルだけを、最速でTASTEFTPファイルが行き交う、いちばん端正な道TASTESSHサーバーとあなたを、より確かにつなぐTASTEZIPより速くまとめ、より安全にひらくTASTEWINM2つの画面で整理する、キーボード中心のファイルマネージャー

開発ツール

TASTECODERust アプリの編集・ビルド・デバッグ・テストまでひとつのウィンドウでTASTESTUDIO編集からリモートテスト、承認した AI 修正までTASTEETL値を見ながら、データを運ぶ

サーバー

TASTEREMOTE自社サーバーで運用するリモートデスクトップTASTEGEOGeoServer 互換の空間情報サーバーを Rust で作り直しますTASTEMAILメールの主導権を、もう一度自分の手に

投資

TASTESTOCKいつ・何を。自分で決めたルールどおりに動く株式自動売買

はじめる

ダウンロード全製品の最新版ドキュメント各製品の使い方購入サブスクリプション・永久ライセンスすべての製品全製品を一覧で
すべての製品
マーケットプレイスニュース
技術

ニュース

今日の開発ニュース言語・フレームワーク・GitHub・AI の公式発表開発ドキュメント言語・フレームワーク・アルゴリズムのガイド

プログラミング言語

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

フレームワーク

Webフロントエンド フレームワークNext.jsReactVue.js · NuxtSvelteKitAngular
サーバー フレームワークSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
アプリ・デスクトップ フレームワークTauriFlutterReact NativeElectron

アルゴリズム

アルゴリズムの基礎計算量解析 · ソート · 探索 · 基本データ構造 · 木構造とヒープ主要アルゴリズムグラフ探索 · 最短経路と最小全域木 · 動的計画法 · 貪欲法 · 分割統治法 · バックトラッキング発展アルゴリズム文字列アルゴリズム · 数学と整数論 · ビット演算 · セグメント木 · Union-Find実務のアルゴリズムコーディング面接対策 · LRUキャッシュ · レート制限 · コンシステントハッシュ法
開発ドキュメントをすべて見る
コミュニティ
プロジェクトビルダーと作品を探す開発ログ決定と試行錯誤プロンプト再利用できる指示AIツールの問題Claude・Codex・Gemini の問題と回避策ショーケース完成した成果コミュニティガイドオープンにつくる方法
協業
技術移転Rust・egui でネイティブアプリを作るウェブサイト構築10言語、アカウント、ドキュメントとダウンロードデスクトップアプリ構築Rust・egui、WebView なしリリース・決済パイプライン署名・MSI・deb・rpm・AppImage・ハッシュ販売パートナー紹介して決済額の30%お問い合わせ構築・提携・投資のご相談
サービス
リモートデスクトップブラウザから自分のパソコンへインストールパッケージのカスタマイズ必要な機能だけ、設定は事前に
購入
JA
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
ログイン
ログイン
TASTEDEV

小さなツールから、より良い開発へ。

support@tastedev.netTASTEDEVを支援
製品製品ラインナップ購入ドキュメントダウンロードマーケットプレイスサポート
コミュニティプロジェクト開発ログプロンプトAIツールの問題ショーケース
ポリシー会社概要プライバシーポリシー利用規約サブスクリプション規約返金ポリシーコミュニティガイドライン
アカウントログイン新規登録
訪問者
今日
昨日
累計閲覧
商号
GXSOFT
代表者
CHOI YOUNG GU
事業者登録番号
853-44-00368
所在地
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
電話
+82-10-4404-1523
メール
whitecalvin@tastedev.net
個人情報保護責任者
CHOI YOUNG GU

© 2026 TASTEDEV製品情報は検証済みの開発ソースに基づいています。リリース・改善中

Spring Boot ドキュメント
Spring Boot
Getting Started with Spring BootProject Structure and ConfigurationCore ConceptsData and StateTestingDeployment
ディスカッション

Spring Boot ガイド · 3/6

Core Concepts

この章は現在、英語でのみ提供しています。

Spring Boot runs on top of the Spring Framework. Spring's IoC container creates your objects and wires them together, and Spring Boot adds starters and auto-configuration so that most of the setup disappears. This chapter covers beans and dependency injection, auto-configuration, starters, the web layer and type-safe configuration.

Beans and dependency injection

An object managed by the container is called a bean. Annotate a class with a stereotype and component scanning registers it:

AnnotationPurpose
@ComponentGeneral-purpose component
@ServiceBusiness logic
@RepositoryData access; translates persistence exceptions
@Controller / @RestControllerWeb request handling

When a bean needs another bean, take it through constructor injection. With a single constructor, @Autowired is unnecessary, and final fields make the class easy to create by hand in tests.

@Service
public class GreetingService {

    private final Clock clock;

    public GreetingService(Clock clock) {
        this.clock = clock;
    }

    public String greet(String name) {
        int hour = LocalTime.now(clock).getHour();
        return (hour < 12 ? "Good morning, " : "Hello, ") + name;
    }
}

For objects you cannot annotate, such as library classes, declare a @Bean method in a @Configuration class:

@Configuration
public class AppConfig {

    @Bean
    public Clock clock() {
        return Clock.systemDefaultZone();
    }
}

Auto-configuration

@SpringBootApplication combines three annotations: @SpringBootConfiguration (a configuration class), @ComponentScan (component scanning) and @EnableAutoConfiguration.

Auto-configuration inspects the classpath and the beans you already defined, then creates the beans you are likely to need. With Spring MVC and Tomcat on the classpath you get an embedded web server and a DispatcherServlet; with a JDBC driver and spring.datasource.url you get a DataSource. Every auto-configuration is guarded by conditions such as @ConditionalOnClass and @ConditionalOnMissingBean, so if you define a bean of the same type yourself, auto-configuration backs off. Your own beans always win.

この章について質問がありますか?
前の章Project Structure and Configuration次の章Data and State

To see which auto-configurations applied and why, run with --debug and read the condition evaluation report. To switch one off entirely, use exclude:

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
public class DemoApplication { /* ... */ }

Starters

A starter is a curated set of dependencies for one capability. A single dependency brings in the libraries and their matching auto-configuration:

  • spring-boot-starter-webmvc: Spring MVC, embedded Tomcat, JSON via Jackson
  • spring-boot-starter-data-jpa: Spring Data JPA with Hibernate
  • spring-boot-starter-validation: Bean Validation
  • spring-boot-starter-security: Spring Security
  • spring-boot-starter-actuator: health checks, metrics and other production features

REST controllers

Methods in a @RestController return objects that are serialized to JSON. Bind path variables with @PathVariable and request bodies with @RequestBody. Java records make good request and response types.

@RestController
@RequestMapping("/api/todos")
public class TodoController {

    private final TodoService service;

    public TodoController(TodoService service) {
        this.service = service;
    }

    @GetMapping("/{id}")
    public TodoResponse get(@PathVariable Long id) {
        return service.find(id);
    }

    @PostMapping
    public ResponseEntity<TodoResponse> create(@RequestBody CreateTodo request) {
        TodoResponse created = service.create(request.title());
        return ResponseEntity.created(URI.create("/api/todos/" + created.id())).body(created);
    }

    public record CreateTodo(String title) {}
    public record TodoResponse(Long id, String title, boolean done) {}
}

Type-safe configuration with @ConfigurationProperties

You can inject single values with @Value("${...}"), but groups of related settings are safer as @ConfigurationProperties. Keys under the prefix bind to the record's components:

@ConfigurationProperties("app.mail")
public record MailProperties(String from, Duration timeout, boolean enabled) {}
app:
  mail:
    from: no-reply@example.com
    timeout: 5s
    enabled: true

Add @ConfigurationPropertiesScan to the entry-point class and these records become beans that other beans can receive through their constructors. Values like 5s are converted to Duration automatically.

A note for Kotlin

Kotlin classes are final by default, which prevents Spring from creating proxies. Kotlin projects from Initializr include the kotlin("plugin.spring") compiler plugin, which opens classes carrying Spring annotations. Constructor injection maps naturally onto Kotlin's primary constructor:

@Service
class GreetingService(private val clock: Clock) {
    fun greet(name: String) = "Hello, $name"
}

Summary

  • The container creates your objects as beans and wires them through constructor injection.
  • Auto-configuration creates beans based on the classpath and conditions; beans you define always take precedence.
  • One starter brings in the dependencies and auto-configuration for a capability.
  • Bind related settings to @ConfigurationProperties records for type safety.

コメント 0件

人気のコメント順新しい順

ログイン · ログインするとコメントできます。