@RequestMapping vs @GetMapping
@RequestMapping can define paths and HTTP constraints generally
The question library
Explore practical questions, clear explanations, and code examples across developer technologies.
Showing 1969–1980 of 3610 questions
@RequestMapping can define paths and HTTP constraints generally
@PathVariable binds a value in the URL path, commonly a resource identifier
@RequestBody deserializes the HTTP request body into a Java object using an HTTP message converter
DTOs define the data exchanged across an API boundary
200 means success, 201 commonly means created, 204 means success with no body, 400 bad request, 401 unauthenticated, 403 forbidden, 404 not found, and 500 unexpected server error
Bean Validation constraints can be placed on DTO fields and triggered with @Valid at the controller boundary
Maven uses a convention-oriented XML build model; Gradle uses a programmable Groovy or Kotlin DSL
DevTools improves local feedback through features such as automatic restart after classpath changes and optional LiveReload
The controller handles HTTP concerns, the service coordinates business rules and transactions, and the repository handles persistence
Spring Data JPA generates repository implementations from interfaces and supports derived queries, JPQL, paging, and sorting
An entity maps a Java class to persistent data and declares an identifier and mapping metadata
Spring Data parses supported repository method names into queries based on entity properties