Home » Enterprise Java » spring

spring

Spring @AliasFor Annotation Example

In this example, we will show how to use the @AliasFor annotation in Spring. 1. Introduction Annotations are decorators that provide metadata about classes, methods, parameters or fields. Depending on the annotation, metadata may be processed at compile-time and/or runtime. Examples of annotations include: JUnit annotations (@Test, @Before, @After)JPA annotations (@Entity, @Table, @Id)Spring Framework annotations (@Controller, @Configuration, @Autowired) Meta-annotations are ...

Read More »

Spring Boot H2 Database Example

Welcome readers, in this tutorial, we will create a spring boot application that connects to an h2 database. 1. Introduction Spring boot is a module that provides rapid application development feature to the spring framework including auto-configuration, standalone-code, and production-ready code It creates applications that are packaged as jar and are directly started using embedded servlet container (such as Tomcat, ...

Read More »

Spring Boot Oracle Connection Example

This article is a Spring Boot Oracle Connection Example. Oracle (Oracle database/RDBMS) is a proprietary multi-model database management system made and marketed by Oracle Corporation. It’s one of the most popular databases used in the world. This article will show you how to connect Spring Boot to an Oracle database. 1. Tools and Requirements Oracle XE free download – requires ...

Read More »

Customize Whitelabel Error Page in Spring Boot

Welcome readers, in this tutorial, we will explore how to create a custom whitelabel error page in a spring boot application. 1. Introduction Spring boot is a module that provides rapid application development feature to the spring framework including auto-configuration, standalone-code, and production-ready code It creates applications that are packaged as jar and are directly started using embedded servlet container ...

Read More »

Setting Up EhCache Without the XML Hassle

1. Introduction In this example, we will go over an easy way to set up EhCache without the XML hassle. This example utilizes the simplicity of Spring Boot and Spring’s Cache annotations. If you are on this page, I can assume you are likely familiar with EhCache. But, just in case, let’s do a short recap. EhCache is an open-source, ...

Read More »

Spring @Conditional Annotation Example

Welcome readers, in this tutorial, we will explore the @Conditional annotation of the spring framework. 1. Introduction Spring 4.0 introduced the @Conditional annotation in spring. It supports the “if-then-else ” conditional checking for bean registration. It offers a higher support level than the existing @Profile annotation in the spring framework. Developers can use the @Conditional annotation for the following reasons: ...

Read More »

Spring Boot Security and JWT Hello World Example

Hi Java Code Geeks. Come follow me as we create a Spring Boot Security and JWT (JSON Web Token) Hello World application. This article is best understood by following it from top to bottom. Concepts and definitions will be explained along the way. This article is not for the absolute beginner. It is assumed that you know your way around ...

Read More »

Spring Form Validation Example

In this example, we will show how to implement server-side form validation in a Spring MVC application. 1. Introduction Form validation is a basic requirement for web applications that accept data as input. For example, you may want to ensure that an email address or credit card number sent in a request is valid before processing the data. There are ...

Read More »

Spring Boot with Flyway and PostgreSQL Example

Welcome Java Code Geeks to the Spring Boot with Flyway and PostgreSQL example. In this example we will imagine ourselves as making an application for a car dealership. Well, just a very tiny fraction of it. As we all know, the software we create changes as the business need changes. PostgreSQL is an object-relational database management system. It’s one of ...

Read More »

Spring Boot add filter Example

In this article, we will see how to configure Filter using Spring Boot. Also, we will see how to configure multiple filters. 1. What are Filters? Filter is an interface available in javax.servlet package which use to perform filtering task on request to a resource (a servlet or static content), or on the response from a resource, or both . In ...

Read More »