Spring framework articles

on waitingforcode.com

Testing views with HtmlUnit in Spring

Testing view part of web applications in Spring isn't a simple task. But to simplify it, you can use libraries as HtmlUnit, a kind of command-line browser written in Java. And Spring Test MVC HtmlUnit allows to integrate this library inside Spring test cases and to write more complex test cases. Continue Reading →

Asynchronous events in Spring

Synchronous events have one major drawback: they're natively executed in the calling thread. If the listener handling on of synchronous events takes 5 seconds to respond, the final user won't able to see the response within at least 5 seconds. However, one alternative solution is proposed to this problem - asynchronous events. Continue Reading →

Custom namespace parser in Spring

In Spring we can configure dependencies in several ways: with XML files or directly in Java using annotations. This first way is usual considered as clearer and simpler to maintain. And if you're working with it, you certainly met some of Spring XML namespaces, as those one for Spring Security or Spring MVC projects. In this article we'll focus on this aspect of Spring. Continue Reading →

Properties placeholder in Spring Framework

Sometimes you will need to share properties values through multiple configuration files. They can, for example, have the same authentication information about database user, but, they can use different databases. In Spring we can resolve this problem with properties placeholders. Continue Reading →

Events and listeners in Spring Framework

Events, and generally callback idea, are very popular in technologies associated to GUI (JavaScript, Swing). On the server side of web applications they're less popular. However it doesn't mean that we can't implement one event-oriented architecture on it. Above all when we're working with Spring. Continue Reading →

Handling annotations with Spring AnnotationUtils

Annotations in Java let us, programmers, to transfer some of configuration from configuration files into Java classes. For example, in Spring, we can configure URL mapping directly inside the controllers thanks to @RequestMapping annotation. But it couldn't be possible without several utilitary classes, like AnnotationUtils, described here. Continue Reading →

Context loader in Spring

Like we already know, application context is the container where Spring-managed beans live. But the question that we didn't ask, is how this context is created ? We'll reply to this question in this article. Continue Reading →