What Is Spring Security? Authentication and Authorization
Spring Security is the standard framework for authentication, authorization and attack protection in Spring apps. See the modern SecurityFilterChain setup with working code.
2,889 posts about Java: questions with answers, tutorials and articles, newest first.
Spring Security is the standard framework for authentication, authorization and attack protection in Spring apps. See the modern SecurityFilterChain setup with working code.
The @Query annotation lets you write JPQL or native SQL for a Spring Data JPA repository method when derived method names are not enough.
Define a JpaRepository interface for an entity, use the built-in CRUD methods, and add derived and custom queries in Spring Boot 3.
Spring Data JPA generates repository implementations on top of JPA and Hibernate. See setup, entities, query methods and common pitfalls.
Compare the ways Spring handles exceptions: controller handlers, @ControllerAdvice, ResponseStatusException and ProblemDetail, with working examples for each.
A Spring controller maps web requests to Java methods. See @Controller vs @RestController, request mapping, validation, error handling and tests.
Advice is the code a Spring aspect runs at a matched join point. Learn the five advice types with examples, execution order and common pitfalls.
Join points in Spring AOP are method executions on Spring beans where advice can run. See pointcuts, advice types, ProceedingJoinPoint and proxy limits.
An aspect is a class with @Aspect and @Component plus pointcuts and advice. Build a working logging and timing aspect for Spring Boot and learn its limits.
Spring AOP applies cross-cutting logic such as logging and security through runtime proxies. See the core concepts and a working aspect example.
The @Autowired annotation tells Spring to inject a matching bean into a constructor, setter or field. Learn the injection styles and why constructor injection is preferred.
Define Spring beans in applicationContext.xml with constructor and setter injection, scopes and placeholders, then load them with ClassPathXmlApplicationContext.
The Spring bean lifecycle runs from instantiation and injection through initialization callbacks to destruction. See the exact order and which callback to use.
A Spring bean is an object managed by the IoC container. See how to define beans with annotations, inject them, pick a scope and use lifecycle callbacks.
Paginate Hibernate queries with setFirstResult and setMaxResults, count total pages, and avoid the in-memory paging trap of collection fetch joins.
SessionFactory is built once per database and creates short-lived Sessions. Learn what it holds, how to bootstrap it in Hibernate 6 and 7, and common mistakes.
HQL queries entities instead of tables and is translated to SQL by Hibernate. See syntax, parameters, joins, projections and bulk updates in Hibernate 6.
The Hibernate configuration file defines connection, mapping and behaviour settings for a SessionFactory. See a working example and modern alternatives.
Use @OneToOne, @OneToMany, @ManyToOne and @ManyToMany with mappedBy and @JoinColumn. Covers owning side, lazy fetching, cascading and the N+1 problem.
Hibernate removes JDBC boilerplate with object mapping, caching and portability. See examples and when plain JDBC is the better choice.