When you use Spring (Boot) you inevitably come around or will use the @ComponentScan annotation to automatically detect your classes (meta) annotated with @Component.
[Read More]
Dependency Injection in Java
Before diving in let’s take a look at two definitions of dependency injection (according to Wikipedia).
[Read More]
Why are my autowired fields null
A commonly asked question on sites like StackOverflow is “Why is the field i’m autowiring null”. When this happens it generally is an error of the user as an autowired field in Spring cannot be null. At startup Spring will try to satisfy all the dependencies of a bean, if...
[Read More]
Delay startup of your Spring Boot application until your DB is up.
When using Spring Boot or just plain Spring Framework it might be that you want to delay the startup of your application until a proper connection to the database can be made. This might be even more the case when using container technologies, like Docker.
[Read More]
Upgrade Spring Framework in an existing application
When working on an existing application using an older version of the Spring Framework (aka Spring) it might be time to upgrade. Although in most cases upgrading to a newer version of Spring is a matter of changing the version. When doing a large upgrade, like from 2.5 to 5.1,...
[Read More]
Data Objects aren't entities
When using a framework like Lombok it is very tempting and easy to use its @Data annotation.
[Read More]
Use JDBI with Spring Boot
As a developer I’m always interested in using different data access technologies instead of plain JDBC. Especially combined with Spring Boot. Recently I came across JDBI and was intested in trying it out with Spring Boot as an experiment.
[Read More]
Use @PropertySource with YAML files
By default the @PropertySource annotation isn’t usable with YAML files. This is also the standard answer given when asked on, for instance StackOverflow (even by me!).
[Read More]
On Spring ApplicationContext and Bean Creation
There appears to be a lot of confusion in the community on how to expression bean configuration or rather how to convert bean configuration from XML to Java (or Groovy, or Kotlin, or…) as it appears as if the different ways of configuration are completely different things.
[Read More]
Spring Framework: "Hidden" Gems
The Spring Framework (and its portfolio projects) contain a lot of functionality already by themselves. However there are also some nice hidden gems inside the framework, in this blog I will (un)cover a couple of them. The code for the sample(s) can be found on Github.
[Read More]
Yeoman behind a (corporate) proxy
After playing around with AngularJS and Yeoman at home I decided to try it out at work. To clarify @Home I use a Mac with OSX and use Homebrew to install additional packages. @Work I have a virtual workstation running Windows 7 installed. Trying out that setup on that configuration was,...
[Read More]
Hibernate Search by Example
In short Hibernate Search by Example is a great how-to guide if you quickly want to get started with Hibernate Search.
[Read More]
Pro Spring MVC: with Web Flow - Sample Application Fails To Start
Update (1-8-2012): Please download the most recent version of the sources from either the GitHub repository or from the Apress website. This version fixes the problem with the project dependencies.
[Read More]
Spring Security 3
Spring Security 3 is a pretty decent book if you want to get started with Spring Security or want to know more of the internals or exotic features it has to offer.
[Read More]
Spring Persistence with Hibernate
This book sets out to explain the usage of hibernate with the spring framework. This is basically done in the first chapters. It explains how to configure hibernate from within a spring ApplicationContext and it explains how to write a dao. To bad that, for the dao, they still use...
[Read More]
Migrate classic J2EE to Spring (Step 1) (revised)
A couple of months ago I wrote a step 1 on migrating a classis J(2)EE application to a spring based application. Recently I had some time again on my hands and after studying the application and also after some discussions I had I decided to structure the project a little...
[Read More]
Spring Web Flow 2 Web Development
A few weeks ago I was contacted by packt publishing to review one of their books. They asked me if I wanted to review Spring Web Flow 2 Web Development (sample chapter).
[Read More]
Migrate classic J2EE to Spring (Step 1)
A few months ago SpringSource released a white paper describing the migration from J2EE to a Spring framework based application. Even before they wrote that white paper I already had the idea of writing something about how to migrate from J2EE to a Spring based application. However Colin Sampaleanu (at...
[Read More]
Configuring JNDI Resources in Tomcat
It seems quite hard to configure a JNDI Resource in Tomcat. Especially when it comes to configuring XA capable resources. The key lies in understanding how Resources work/need to be configured. A Resource has a few properties which are used by Tomcat, those are the auth, name, description, scope and...
[Read More]
Securing Spring Web Flow
Well that is the title of the presentation I just gave at the NL-JUG 2007 conference. The presentation was about the Spring Web Flow solution we created to secure flows. The presentation can be found and the conference website. The code is available in the JIRA under issue SWF-93 but...
[Read More]
Converting String to Date and Date-formatting in Spring-MVC
This week alone I answered the question about date formatting and how to bind Strings to Objects multiple times. If I would get an euro/dollar for everytime I gave the same answer. So I figured maybe it is time to create simple example to show how it is done in...
[Read More]
One application, per client database
In one of my recent projects we came a cross an application model which had 1 codebase but for every client they had (around 40) they deployed one application. Sometimes they had to redeploy several times because they had memory and performance issues. We soon realized that we needed to...
[Read More]
Spring Web Flow Tag Library
A while ago we started to use Spring Web Flow. We needed to convert our old WizardForms and Multi SimpleFormController screens to the Spring Web Flow ones. After converting about three jsp’s I got fed up with the hidden fields, the submit buttons with the specified name. Generating urls with...
[Read More]
Using multiple validators in Controllers and FormAction
On a job I did recently we did a lot of refactoring the old (web) application, they used an abundance of (Web) Frameworks, we reduced it to 1 (well actually 2 if you count Spring Web Flow :) ).
[Read More]