A Guide to the Front Controller Pattern in Java 1. Overview In this tutorial we’ll be digging deeper into the Front Controller Pattern, part of the Enterprise Patterns as defined in Martin Fowler‘s book “Patterns of Enterprise Application Architecture”. Front Controller is defined as “a controller that handles all requests… Continue Reading java-front-controller-pattern

Elasticsearch Queries with Spring Data 1. Introduction In a previous article, we demonstrated how to configure and use Spring Data Elasticsearch for a project. In this article we will examine several query types offered by Elasticsearch and we’ll also talk about field analyzers and their impact on search results. 2.… Continue Reading spring-data-elasticsearch-queries

Custom User-Agent in HttpClient 4 1. Overview This quick tutorial will show how to send a custom User-Agent header using Apache HttpClient 4. 2. Setting User-Agent on the HttpClient ==== 2.1. Before HttpClient 4.3 When working with older versions of Http Client (pre 4.3), setting the value of the User-Agent… Continue Reading httpclient-user-agent-header

Use Criteria Queries in a Spring Data Application 1. Introduction Spring Data JPA provides many ways to deal with entities including query methods and custom JPQL queries. However, sometimes we need a more programmatic approach: for example Criteria API or QueryDSL. Criteria API offers a programmatic way to create typed… Continue Reading spring-data-criteria-queries

Using a Custom Spring MVC’s Handler Interceptor to Manage Sessions Spring MVC 1. Introduction In this tutorial, we are going to focus on the Spring MVC HandlerInterceptor. More specifically, we will show a more advanced use case for using interceptors – we’ll emulate a session timeout logic by setting custom… Continue Reading spring-mvc-custom-handler-interceptor