Browse Category

Java

Jackson Java Spring

Jackson Supporting JAXB Annotations in Spring

Spring Framework by default is using JAXB for binding XML schemas and Java objects. When we generate our Java representations from XML schema using JAXB, our POJOs will contain JAXB annotations like @XmlRootElement, @XmlElement, etc. If we want Spring to use Jackson with our POJOs generated by JAXB, we will have to add following dependency to our pom.xml file:

Keep Reading

Spring Application Coding

Building Spring Boot Application with FreeMarker, JPA, REST and Groovy Spock Tests

In this simple example I would like to show you how to build an application using a few technologies like Spring Boot with FreeMarker Java Template engine for rendering the view, Java Persistence API for storing our objects into the database and simple REST API for application’s data manipulation. We will add some Groovy integration tests using Spock testing and specification framework. Our application functionality will be very simple. We will be able to add users using both rendered HTML page and REST API and store them into in-memory¬†Java SQL database called H2. The list of users will be displayed on the main page.

Keep Reading

Jackson Java Spring

Searching for files in Java 8 using Files.find() method, streams and lambda expressions

Since Java 8 we have a new way of finding files in a file tree using find() method from Files class. This class contains a set of static methods used for operating on files, directories, or other types of files. In this post we will implement functionality of finding files which were modified given number days ago.

Keep Reading