Blog Archives

Basic Java Application Project Using Gradle

Here is how to setup a Gradle build to run a basic Java project through the main method: Create a folder for the project. In this example, we will name the folder basic-java. Create a Java file, called, inside

Posted in Gradle Tagged with: ,

How to Install Gradle

Gradle is a dependency management / build tool that combines the best of Maven and Ant, making it an extremely powerful and customizable tool. It also uses a sleek Groovy DSL instead of the XML approach of Maven and Ant

Posted in Gradle Tagged with: , ,

Joda-Time – How to Parse a String to Joda LocalDate

Parsing a string into a Joda-Time LocalDate object is easy. It took me a while to realize that LocalDate has a constructor which can take a date String. Example usage: The constructor’s signature is actually LocalDate(Object instant), which is why

Posted in Java Tagged with:

How to Install Maven

Maven is a popular, if not the most popular, Java build tool and dependency management framework. It is a good idea to use a build tool rather than rely on your IDE build scripts if you are planning on collaborating

Posted in Maven Tagged with: , ,

Spring Java Configuration

I have found that a lot of Spring developers I know still do not know about or use Spring Java Configuration (aka JavaConfig). Spring 3.0 introduced this feature which allows Spring to be configured entirely in Java – no more

Posted in Spring Tagged with: , , ,

Explicitly defining a Spring MVC Annotation-Based Controller

Beginning with Spring MVC 2.5, MVC controllers can be declared using theĀ @Controller annotation. Spring picks up the controller through this declaration in Spring servlet application context: <context:component-scan base-package=”com.myapp.controller” /> In the past, this has worked perfectly for me, and I

Posted in Java, Spring Tagged with: , ,


Follow Me

RSS FeedFollow me on Twitter