All posts in " java "
Share

SLF4J LOG4J2 Configuration

By Daniel Vladimirov / a couple of months ago

Using the simple logging facade for Java (slf4j) with Apache log4j 2 is pretty straightforward and can be done literally in a minute. The slf4j allows you to plug in the desired logging framework at runtime, giving you the flexibility to change it when such a requirement is present. It’s a popular logging abstraction library […]

Share

Spring REST Request Body Validation

By Daniel Vladimirov / 6 months ago

@RequestBody validation is important for your REST APIs, because it protects your service layer from bad input and prevents a bad request to ever reach your business logic. User input validation in Spring is not hard to implement, because of the built-in support for JSR-303 bean validation, which makes it quite straightforward for most cases […]

Share

Handle POST and PUT requests with Spring Boot

By Daniel Vladimirov / 6 months ago

In this tutorial we’ll handle POST and PUT requests sent to our server, we’ll create and update entities and use in-memory data structures to represent our database.   POST and PUT are one of the most common HTTP methods, usually used for creating and modifying data on the target server, which is also the main […]

Share

How to change the Spring Boot container – Tomcat to Undertow

By Daniel Vladimirov / 6 months ago

In this tutorial we are going to look at how we can easily change our embedded servlet container in our Spring Boot web application. If you don’t have any source code to work on, I’m going to use the same application we created in the previous article, which you can check out here https://simplyprogram.com/how-to-create-a-simple-web-application-with-spring-boot/ For […]

Share

How to create a simple web application with Spring Boot

By Daniel Vladimirov / 6 months ago

In this quick tutorial we are going to start up a Spring Boot application and configure a single and very simple controller that will respond to a GET request and greet the user with a message. There is very little time involved in initially setting up Spring Boot for development, which is one of the […]