This blog post wants to show another approach how to implement the Strategy Pattern with dependency injection. As DI framework, I choose Spring framework From Wikipedia Firstly, let's have a look how the Strategy Pattern is implemented in the classic way. As starting point, we have a HeroController that should add …
Read MoreFrom a certain point on, an application has to be configurable. Spring Framework has a nice auxiliary tool for this issue since the first version 0.9 , the class PropertyPlaceholderConfigurer and since Spring Framework 3.1 the class PropertySourcesPlaceholderConfigurer. When you start a Google search for …
Read MoreThis post describes how to set up a Maven project for a Spring web application with Hessian Service. It also shows how to set up the deployment for exposing the Hessian service and how to set up a client to consume the Hessian service. The Spring Framework version is 3.1.1.RELEASE and the Hessian version is 4.0.7. …
Read MoreTo read resources from classpath, you can use the Spring class ClassPathResource. The constructor with one argument reads only resources from file system. But sometimes you want to read a resources from a jar file in the classpath. For this case, you must build an own URLClassLoader from the URL of the jar file and use …
Read More