What is the difference between Basic and form-based authentication?
Compare Basic and form-based authentication in Java: how each works, security trade-offs, Spring Security configuration and when to use which.
2,889 posts about Java: questions with answers, tutorials and articles, newest first.
Compare Basic and form-based authentication in Java: how each works, security trade-offs, Spring Security configuration and when to use which.
Set up Spring Security authentication using a SecurityFilterChain, database users, bcrypt hashing, form login, Basic and OAuth 2.0 JWT.
Spring Security runs as a chain of servlet filters. See the default order, how to configure a SecurityFilterChain and how to add a custom filter.
It bundles Spring Data JPA, Hibernate and a connection pool so you can define repositories and run CRUD queries with minimal configuration.
Page and sort query results in Spring Data with Pageable, PageRequest and Sort, and choose between Page and Slice return types.
Compare the data access options in Spring, from JdbcClient and Spring Data JPA to R2DBC, MyBatis, MongoDB and Redis, with short examples for each.
Learn declarative and programmatic transaction management in Spring: @Transactional, propagation, rollback rules and the pitfalls that break them.
@Transactional wraps a method in a transaction that commits on success and rolls back on runtime exceptions. Learn its attributes and common pitfalls.
@Query lets you write the JPQL or native SQL for a Spring Data repository method instead of relying on derived method names.
Learn how to define a Spring Data repository interface and use derived queries, @Query, paging, projections and @DataJpaTest in Spring Boot.
Spring Data provides repository interfaces and generated queries for relational and NoSQL databases, removing most boilerplate data-access code.
Compare compile-time weaving, Spring AOP proxies and AspectJ load-time weaving: when advice is applied, the overhead, limits and when to choose each.
A join point is where advice can run, and a pointcut selects which join points match. Learn execution expressions, advice types and proxy limits with code.
@Around advice wraps a method call in Spring AOP and controls whether, how and with what result the target runs, using ProceedingJoinPoint.proceed().
Build a Spring AOP aspect with @Aspect, a named pointcut and the five advice types. Includes ordering, pointcut designators and the proxy limits to watch for.
Spring AOP moves logging, security and transactions out of business code. See the advantages, a working aspect and the proxy limits to watch.
Spring beans are singletons by default, one shared instance per container. Prototype beans are created on every request. See the lifecycle and injection pitfalls.
Spring bean scopes control how many instances exist and how long they live. Learn each scope, the @Scope annotation and how to inject short-lived beans safely.
A @Bean method returns an object that Spring registers as a managed bean. See when to use it instead of @Component, with working examples.
@Configuration declares a class as a source of Spring bean definitions through @Bean methods. See proxyBeanMethods, profiles and how it differs from @Component.