In this article, we will learn how to create a Spring Boot JPA One To One mapping using Spring Data JPA with Foreign Key. In this approach, we will have two tables with different primary keys. The primary key of the STUDENT table (ID) will act as a foreign key for the PASSPORT table and PASSPORT table will have its own primary key (ID). … [Read more...]
Spring Security – JdbcUserDetailsManager Example | JDBC Authentication and Authorization
In the previous article, we have learned about Spring InMemoryUserDetailsManager which internally stores and retrieves the user-related information, Spring Security's JdbcUserDetailsManager class uses the database to store and retrieve the user information. In this JdbcUserDetailsManager Example, we perform Create, Read, Update, and Delete (CRUD) operations on the user details … [Read more...]
Spring Security – InMemoryUserDetailsManager Example | In-Memory Authentication
Spring In-Memory authentication uses InMemoryUserDetailsManager internally store and retrieve the user-related information which is required for Authentication. In this InMemoryUserDetailsManager Example, we will learn how to create and store the user to the in-memory HashMap, update the user credentials and finally delete the User. … [Read more...]
Spring Data REST Example – Spring Boot RESTful API + CRUD
Spring Data REST is built on top of the Spring Data repositories and it automatically exposes the repositories as REST services. Spring Data REST takes the features of Spring HATEOAS and Spring Data JPA and combines them together, using a Strategy called "RepositoryDetectionStrategy" to export the repository as a REST resource. In this Spring Data REST Example, let's create a … [Read more...]
Spring Interceptor Example | HandlerInterceptor | HandlerInterceptorAdapter
Spring Interceptor is similar to a Filter, which is used to intercept the request and process them. Spring MVC allows you to intercept web requests for pre-handling and post-handling through Handler Interceptors. All the Interceptor class must either implement the HandlerInterceptor interface or extend the HandlerInterceptorAdapter class. Spring … [Read more...]
Spring Security Custom Login Form Example | Java Configuration
In this Spring Security Custom Login Form Example, we will learn how to build a Spring MVC application which will be protected by Spring Security. We will be building our own login form rather than using the default form provided by Spring Security … [Read more...]
Spring MVC Multiple File Upload Example | CommonsMultipartResolver
In this Spring MVC Multiple File Upload Example, we will learn how to upload multiple files in Spring MVC using CommonsMultipartResolver. We must add the Apache Commons File Upload dependency (commons-fileupload.jar) in order to use CommonsMultipartResolver. … [Read more...]
Spring Boot auto-configuration | @SpringBootApplication Annotation Example
Spring Boot provides the @SpringBootApplication annotation [from Spring Boot 1.2.0] in order to enable auto-configuration feature, the @SpringBootApplication annotation performs the work of the three annotations @Configuration, @ComponentScan and @EnableAutoConfiguration. @Configuration - Allows you to register beans or import additional configuration class … [Read more...]
Spring MVC 5 Thymeleaf 3 Hello World Example
Thymeleaf is a Java template engine for processing HTML, XML, JavaScript, CSS, and text. In this Spring MVC 5 Thymeleaf example, we will learn how to configure Thymeleaf with Spring MVC. We need to add the dependency "thymeleaf-spring5" in order to use Thymeleaf in our Spring MVC 5. … [Read more...]
Spring Boot Logging – Logback | RollingFileAppender + SpringProfile
Logback is the successor of the popular logging framework log4j. Logback is an excellent choice for enterprise applications since it’s fast, simple yet powerful. Common Logging will be automatically included when we use any of the Spring Boot Starter dependencies since they internally include spring-boot-starter-logging. In this Spring Boot Logging - Logback example, we will … [Read more...]
Spring Boot Log4j2 Example | XML + YAML + JSON
Spring Boot by default uses Logback framework for logging when we use Spring Boot Starter dependency. Apache Log4j 2 is the successor of Log4j which provides significant improvements over its predecessor Log4j 1.x and provides many of the features available in Logback. In this Spring Boot Log4j2 Example, we will learn how to configure the log4j 2 framework in Spring boot … [Read more...]
Spring Boot HikariCP Connection Pool Example | MySQL
HikariCP is a lightweight and highly optimized Java connection pool. Connection Pooling is a technique of creating and managing a pool of connections which is already created and ready for use by any process which needs them. In this Spring Boot HikariCP Connection Pool example, we will learn how to use HikariCP with Spring Boot. … [Read more...]
- 1
- 2
- 3
- …
- 7
- Next Page »