What is the significance of the ExceptionMapper interface?
ExceptionMapper converts exceptions thrown by Jakarta REST (JAX-RS) resources into consistent HTTP responses. See examples, selection rules and good practice.
2,881 posts about Java: questions with answers, tutorials and articles, newest first.
ExceptionMapper converts exceptions thrown by Jakarta REST (JAX-RS) resources into consistent HTTP responses. See examples, selection rules and good practice.
Map Java exceptions to clean HTTP responses in JAX-RS with ExceptionMapper, covering custom exceptions, validation and a Throwable fallback.
@QueryParam binds URL query string values to JAX-RS and Jakarta REST resource method parameters, with type conversion, defaults and support for repeated values.
Read filter and sort options from query parameters, validate them against an allow-list and apply them with streams or database queries in a JAX-RS resource.
@Path maps a URI to a JAX-RS resource class or method. Learn how paths combine, how templates and regular expressions work, and the jakarta.ws.rs package.
Build a REST API with JAX-RS and Jersey using the jakarta.ws.rs namespace, JSON via Jackson, an embedded Grizzly server and exception mappers.
@Transactional gives MongoDB multi-document ACID transactions in Spring only with a MongoTransactionManager bean and a replica set. Setup, rollback rules and pitfalls.
Configure a replica set and MongoTransactionManager, then use @Transactional for multi-document ACID transactions in Spring Boot.
Build MongoDB aggregation pipelines with $match, $group, $sort and $lookup, first in mongosh and then in Java with the official driver builders.
@MongoEntity belongs to Quarkus MongoDB with Panache and sets the collection, database and client of an entity. Spring Data MongoDB uses @Document instead.
Create a Spring Data MongoDB repository with @Document and MongoRepository, add derived and @Query methods, paging, and tests with Testcontainers.
MongoTemplate is the central Spring Data MongoDB API for CRUD, queries and aggregations. See what it does and when to prefer it over repositories.
Build a Spring Boot and MongoDB app with Spring Data: configuration, document mapping, repositories, pagination, MongoTemplate aggregation and a Testcontainers test.
Pass a Pageable to repositories or NativeQuery, sort on keyword fields, and use search_after for deep paging past 10,000 hits.
@Query lets a Spring Data Elasticsearch repository method run a hand-written JSON Query DSL search, with placeholders and paging, when derived names fall short.
Build full-text search with Elasticsearch and Spring Data Elasticsearch: analyzers, mappings, indexing and multi_match queries with filters.
@Document marks a class as a persistent document in Spring Data. See how it maps to an Elasticsearch index or a MongoDB collection, with examples.
Annotate an entity with @Document and let Spring Data create the index, or call indexOps explicitly. Includes Boot 3 properties, mappings and reindexing.
ElasticsearchRestTemplate wrapped the High Level REST Client for indexing and searching. Learn how it works, why it is deprecated and how to migrate.
Integrate Spring Boot with Elasticsearch using Spring Data Elasticsearch: configuration, document mapping, repositories, full-text queries with NativeQuery and testing.