Learn Spring Boot

News

Two Login Form in One Login Page Spring Boot Security

In this post, we will see how to create two login form in a login page using spring boot security in java. The spring boot security module is used to validate these two login forms in one login page. The multiple login forms can be added as like the example

Spring Boot @Value Annotation

@Value spring boot annotation is used to inject values from the properties file into the java variables that have been configured. The @Value annotation in spring boot is used to assign values to variables and method parameters from properties files or system environments. The annotation @PropertySource is used to read

Circular view path

The Circular view path error in spring boot occurs when the request mapping url and the model view url are the same in a rest controller method and no ViewResolver is configured. The check your viewresolver setup! error occurs because the view path url points to the request mapping annotation

How to enable Hibernate logs in Spring Boot

In Spring boot, hibernate logs should be enabled to debug the database connection and SQL query execution. By default hibernates logs are disabled in spring boot application. The hibernate logs can be enabled using the spring boot configurations. There are different configuration parameters that logs different features of hibernate. For

Print Hibernate SQL query string with parameter values in Spring

In the spring boot application, if the hibernate log is enabled using the JPA spring boot configuration, the sql query will be printed. The value of the parameters is not logged in the hibernate log files. The default JPA spring boot configuration will enable sql queries to be logged as they are. Configuration will not enable the values of the parameter to log. If the sql query log is enabled using the hibernate logger directly, the hibernate class will log the query and query parameter values. The spring boot JPA will allow to print only sql queries. Hibernate log JPA Configuration The following jpa configurations will enable hibernate log in the spring

RuntimeException: Driver claims to not accept jdbcUrl

Spring boot RuntimeException java.lang.RuntimeException: Driver claims to not accept jdbcUrl happens when an inappropriate data source url is configured to connect to a database. The database driver can accept the jdbc url in a particular format. If the jdbc url format is different from expected one, RuntimeException Driver claims to

@Async not working Spring Boot – Troubleshoot

The spring boot @Async annotation is used to execute a method asynchronously. This means that the @Async annotation helps to invoke a method and forget about it. The call method will not wait for the completion or response of the asynchronous method. This improves the efficiency of the application by

@Async Exception handling Spring Boot

The spring boot @Async annotation enables the class method to run asynchronous. The handling of the exception in the @Async annotation method is therefore complex. Spring boot supports the default Async Uncaught Exception handler that throws the actual exception in the console log. Spring boot allows the Async Uncaught Exception

How do I POST JSON data with Curl

To post JSON data with Curl, use the -X POST option and pass the JSON data using the -d command line parameter, with the Content-Type set to -H “Content-Type: application/json”. The curl post with json data uses the curl command to send JSON data to the HTTP POST method. Curl

Spring Boot @PathVariable Annotation

The annotation @PathVariable in the spring boot is used to bind the template variable in the request url to the method parameter variable in the rest controller. The spring boot @PathVariable annotation finds the template value in the request url using the template and attaches the value to the method

Most Viewed