Glossary
115 terms from Spring Boot Basics, in plain words, each with the chapter that teaches it.
#
- ./mvnw
- The commands you run with the wrapper: spring-boot:run starts the app, test runs the tests and package builds the jar after running the tests.
- @AutoConfigureMockMvc
- A test annotation that adds a MockMvc bean to the test's application context. Tests use it to send fake requests without starting a real server.
- @Autowired
- An older annotation that marks a constructor or field for dependency injection. It isn't needed on a single constructor, but it is used on fields in tests.
- @Bean
- Marks a method in a @Configuration class whose return value Spring keeps as a bean. It is how you add objects you can't annotate yourself, such as Java's Clock.
- @Component
- Annotations that make a class a bean. @Service marks business rules and @Repository marks data storage; both are @Component with clearer names.
- @Configuration
- Marks a class that holds @Bean methods. Spring runs them to create beans such as Kettle & Crane's Clock.
- @ConfigurationProperties
- Binds every property with a given prefix, such as shop., to the components of a record. @ConfigurationPropertiesScan makes Spring find these records and turn them into beans.
- @DataJpaTest
- A test annotation that starts only the JPA part of the app: entities, repositories and an in-memory database. It skips controllers and seed runners, and rolls back each test.
- @ElementCollection
- Stores a list inside an entity in its own table, linked by a column. The order's lines go into order_lines, linked by order_id.
- @Embeddable
- Marks a type with no id of its own that is stored inside an entity, such as OrderLine inside Order.
- @Entity
- Maps a class to a database table. Each object of the class becomes a row and each field a column.
- @ExceptionHandler
- Marks a method that catches one exception type and returns the error response. It lives in a @RestControllerAdvice class.
- @GeneratedValue
- Tells the database to choose the id of an entity (1, 2, 3…). The id stays null until the entity is saved.
- @GetMapping
- Connects a handler method to one HTTP method and path. @GetMapping("/hello") answers GET /hello.
- @Id
- Marks the field that is an entity's primary key, such as a product's sku.
- @Order
- Ranks advice classes. HIGHEST_PRECEDENCE puts ApiErrors first so its handlers run before Spring Boot's own. It is unrelated to the Order entity.
- @PathVariable
- Passes a {name} part of the URL path into a method parameter, such as the SKU in /api/products/HE-5LB.
- @Primary
- Tells Spring which bean to pick when several beans match the type that is asked for.
- @RequestBody
- Tells Spring to read the request body as JSON and turn it into a Java object.
- @RequestMapping
- When put on a controller class, sets a path prefix that every handler method in it starts with, such as /api/products.
- @RequestParam
- Hands one query parameter to a method. It is required unless you set required = false or a defaultValue.
- @ResponseStatus
- A shortcut annotation that gives a method a fixed status such as HttpStatus.CREATED.
- @RestController
- Marks a class that handles web requests and whose methods' return values become the response body.
- @RestControllerAdvice
- Marks a class whose @ExceptionHandler methods apply to every controller. It is the one place that turns exceptions into error responses.
- @SpringBootApplication
- Marks the main class of a Spring Boot app. It switches on auto-configuration and component scanning from that class's package.
- @SpringBootTest
- Starts the whole application context for a test, as main would, but without a real server.
- @Table
- Sets the table name of an entity. Order uses @Table(name = "orders") because order is an SQL keyword.
- @Transactional
- On a test class, wraps each test in a transaction and rolls it back at the end, so tests don't affect each other.
- @Valid
- Placed before @RequestBody, it makes Spring check the object's constraints. Inside List<...> it checks every nested item. A bad request gets a 400 before the method runs.
- @Value
- Injects one property into a constructor parameter, written as @Value("${name}").
A
- Actuator
- The part of Spring Boot that adds endpoints under /actuator for looking inside a running app, such as health, info and metrics.
- Annotation
- A label starting with @ that gives tools extra information. Spring reads annotations as the app starts and acts on them.
- API (application programming interface)
- A way for one program to use another. A web API answers HTTP requests with data instead of web pages.
- Application context
- Spring's container that creates the beans and keeps them, joining each to the beans it needs.
- application.properties
- The file in src/main/resources where an app's settings live as name=value lines. Profile files such as application-dev.properties add or override settings; application.yml is the same in YAML format.
- AssertJ
- A test library for readable checks such as assertThat(x).isEqualTo(y), with clear failure messages.
- Auto-configuration
- Spring Boot setting up the libraries it finds in your project with sensible defaults. Add the web starter and you get a working web server without setup code.
B
- Bean
- An object that Spring creates and manages. Spring creates the store, then the service, then the controller and passes each into the next.
- Bean Validation
- The Java standard for checking objects by putting a constraint, a rule written as an annotation, on each field. Examples are @NotBlank and @Positive.
- Body
- The data sent along with a request or response, such as the JSON of a new product.
C
- Clock
- The `java.time.Clock` object that `LocalDate.now(clock)` reads the current time from. Making it a Spring bean lets tests supply a clock fixed on one moment, such as a Saturday, so time-dependent code gives predictable results.
- Command-line argument
- A setting given after the command, such as --shop.flat-shipping-cents=900. It wins over environment variables and files.
- CommandLineRunner
- A functional interface whose run method Spring calls once the app has started. Returned from a @Bean method, it seeds the six products into the database.
- Component (health)
- One thing a health check checks, such as db or diskSpace. The overall status is UP only if every component is.
- Component scanning
- Spring searching the main class's package and every package below it for classes marked @Component and its relatives. A class in any other package is never found.
- ConcurrentHashMap
- A thread-safe `Map` implementation that many threads can read and update at the same time without corrupting its data. It suits shared in-memory data in a web app, such as Kettle & Crane's products, because Tomcat handles many requests on separate threads at once.
- Constructor injection
- Spring passing a bean what it needs as constructor arguments. It is the recommended way, and a single constructor needs no annotation.
- Content-Type
- The header that says what kind of data the body holds, such as application/json. curl needs it when sending a JSON body.
- Controller
- A class that handles HTTP requests. Each method that answers one endpoint is a handler method that Spring calls for you.
- curl
- A command-line program that sends web requests and prints the answer. -i shows headers, -s hides the progress meter, -X sets the method, -H adds a header and -d gives the body.
- Custom exception
- Your own exception class extending RuntimeException, such as ProductNotFoundException. The service throws it and ApiErrors turns it into an HTTP answer.
D
- Database
- A program that stores data in tables of rows, with one value per column. SQL is the language used to ask it questions.
- Dependency (Maven)
- A library your project uses, listed in pom.xml. Spring Boot's parent POM supplies the version.
- Dependency injection
- Handing an object the things it needs instead of letting it create them. The service asks for a store in its constructor and Spring passes it in.
- Derived query method
- A repository method whose query Spring Data builds from its name, such as findByPriceCentsLessThanEqualOrderBySkuAsc. A misspelled field stops the app at startup.
- DispatcherServlet
- Spring's front desk. It receives each request from Tomcat and finds the handler method that matches the method and path.
- DTO (data transfer object)
- A type that only carries data in or out of an API, such as ProductRequest or OrderView, kept separate from the database entity.
E
- Embedded server
- A web server that runs inside your app, so the app is one program started with java. Spring Boot uses Tomcat, which listens on port 8080 by default.
- Endpoint
- One HTTP method plus one path, such as GET /products.
- Entity
- A class whose objects are stored as rows in a table. It must be a class with a no-argument constructor, not a record.
- Environment variable
- A NAME=value setting that a terminal passes to every program it starts. It can supply a Spring property, and it beats profile files.
- Executable jar
- One file holding your classes and every library, Tomcat included, built by ./mvnw package and run with java -jar anywhere Java 25 is installed.
F
- Framework
- Code that runs your program and calls your code at the right moments, unlike a library, which you call yourself.
H
- H2
- A small Java database that runs inside your app, in memory. Nothing needs installing, and it starts empty each time.
- Header
- A named Name: value line of extra information in a request or response, such as Content-Type or Location.
- Health check
- A URL that answers whether an app is working. Actuator's /actuator/health returns UP, or DOWN with HTTP status 503.
- Hibernate
- The ORM that Spring Boot uses to implement JPA. It turns entities into rows and back, and can print the SQL it runs.
- HTTP (HyperText Transfer Protocol)
- The protocol browsers, apps and curl use to talk to web servers. The client sends a request (method, path, headers, body) and the server sends back a response (status, headers, body).
- HTTP method
- The part of a request that says what to do: GET reads, POST creates, PUT replaces and DELETE removes.
- HttpStatus
- Spring's enum of status codes, such as HttpStatus.CREATED and HttpStatus.NOT_FOUND.
J
- Jackson
- The JSON library in the web starter. It serializes returned objects into JSON and deserializes request bodies into objects.
- JDK (Java Development Kit)
- The set of tools needed to compile and run Java code, including the compiler and the Java runtime. Build tools such as Maven find the JDK to use through the `JAVA_HOME` environment variable, which points to the JDK's folder.
- JPA (Jakarta Persistence)
- The Java standard for ORMs, which turn objects into database rows and back. Hibernate is the ORM Spring Boot uses for it.
- JpaRepository
- The Spring Data interface you extend, such as JpaRepository<Product, String>, to get save, findById, findAll and more. Spring writes the implementing class at startup.
- JSON (JavaScript Object Notation)
- A text format for data: objects in {}, arrays in [], strings, numbers, true, false and null. It is the usual format for API data.
- jsonPath
- A way to point into a JSON body in a test: $ is the whole body, $.name a field, $[0].sku the first element's sku.
- JUnit
- The Java testing framework from the earlier book. The test starters bring it along with Spring's testing support.
L
- Lazy loading
- An entity's list, such as an order's lines, is loaded from the database only when something reads it. The open-in-view setting keeps the session open so this works while the response is written.
- Liveness and readiness
- Two health groups in Actuator's health answer: liveness asks "is it running?" and readiness asks "can it take requests?". Hosting platforms use them.
- localhost
- The name your computer uses to reach itself. localhost:8080 is the app running on your own machine.
- Location
- The header that tells a client where a newly created resource lives, such as /api/orders/1. It is sent with 201 Created.
- Log level
- How serious a log message is: ERROR, WARN, INFO or DEBUG. Boot shows INFO and above by default, and logging.level.<package> changes it. SLF4J is the logging API Spring uses.
M
- Maven
- The build tool that compiles the project, runs its tests, manages its dependencies and packages the jar. The Maven Wrapper runs it for you.
- Maven Wrapper
- The mvnw script in every project. It downloads the right Maven for you, so you don't install Maven yourself.
- MethodArgumentNotValidException
- The exception Spring throws when @Valid finds a broken constraint. Its getBindingResult().getFieldErrors() lists each bad field and message, which ApiErrors turns into an errors map.
- Metric
- A number the app keeps about itself, such as memory used or requests served. /actuator/metrics/http.server.requests counts and times requests.
- MockMvc
- Sends fake requests straight to Spring's DispatcherServlet in a test, with no real server or port. perform returns a ResultActions, which you call andExpect on.
P
- Parent POM
- The spring-boot-starter-parent your project inherits from. It knows a tested version of every library Boot supports, so dependencies need no version.
- Path variable
- A value inside the URL path, marked {sku} in the mapping, such as HE-5LB in /products/HE-5LB.
- POM (pom.xml)
- The file that tells Maven about your project: its name, Java version and dependencies.
- Port
- A numbered door on a computer where one program listens. Tomcat listens at 8080 unless server.port changes it.
- Primary key
- The column that identifies each row, such as sku for products.
- ProblemDetail
- Spring's type for the standard error body of RFC 9457, sent as application/problem+json. It has title, status, detail and instance, and setProperty adds extra fields such as errors.
- Profile
- A named set of extra settings, such as dev or prod. Boot reads application-dev.properties only when the dev profile is active.
- Property
- A name=value setting. Relaxed binding means dashes, underscores and capitals don't matter, so free-shipping-from-cents matches freeShippingFromCents.
Q
- Query parameter
- A name=value pair after the ? in a URL, such as ?maxPriceCents=2000. Several are joined with &.
R
- Record
- A compact Java class that just holds data, declared with a list of components, such as `Product(String sku, String name, int priceCents, int stock)`. Jackson turns each component into a JSON field of the same name, and a record cannot serve as a JPA entity.
- Repository
- An object that saves and finds entities. With Spring Data you only write an interface, and Spring writes the implementation.
- ResponseEntity
- A whole response: status, headers and body. Methods such as ok, notFound, created and noContent build common ones, and ResponseEntity.of turns an Optional into 200 or 404.
- ResponseStatusException
- An exception that carries an HTTP status and reason, which Spring turns straight into a response. It's quick but puts HTTP details into the service.
- REST
- A common style for web APIs where each kind of thing is a resource with its own path, such as /products, and the HTTP method says what to do with it.
S
- Seed data
- Rows added at startup because the database starts empty. Kettle & Crane's six products are seeded with a CommandLineRunner if count() is 0.
- Serialize
- Serializing turns an object into JSON. Deserializing turns JSON into an object, matching JSON field names to record components. Jackson does both.
- Singleton
- The default bean scope: Spring creates one shared instance and gives it to everyone. One controller therefore serves all requests on many threads, so beans should be stateless or thread-safe.
- Spring Boot
- The tool built on Spring that adds starters, auto-configuration and an embedded server so an app is easy to set up and run.
- Spring Data JPA
- The library that sits on top of JPA and writes the code that saves and finds objects, so you only declare a repository interface.
- Spring Framework
- The most widely used Java framework for business software, which Spring Boot is built on. It runs your program and calls your code.
- Spring Initializr
- A free website at start.spring.io that generates a ready-to-run Spring Boot project with the Maven layout and dependencies you choose.
- spring-boot-maven-plugin
- The Maven plugin listed in <build> that adds commands to run and package the app and makes the jar an executable fat jar.
- Starter
- One dependency per job, such as spring-boot-starter-webmvc, that brings every library the job needs at versions that work together.
- Status code
- The number in an HTTP response that says how the request went: 200s mean success, 400s a client mistake, and 500s a server problem. Common ones are 200 OK, 201 Created (new resource), 204 No Content (OK, empty body), 400 Bad Request (bad data), 404 Not Found, 409 Conflict (clashes with current state), 500 Internal Server Error (a bug) and 503 Service Unavailable (such as a health check reporting DOWN).
T
- Test starter
- A starter such as spring-boot-starter-webmvc-test, added in test scope, that brings JUnit, AssertJ and Spring's testing support. Each main starter has a matching -test starter.
- Transaction
- A group of database changes that succeed or fail together. Each repository call runs in its own transaction.