Archive for the ‘Java’ Category

Iterate over a Map using Java 5 generics

Sunday, August 2nd, 2009

One of the coolest features in Java 5 is the enhanced for loop. Instead of having to use clunky Iterators to loop through a Map, you can use the enhanced for loop just as though you were iterating over an array, a List, or other collection. (more…)

Managing legacy user login object with Spring (Part 2)

Friday, June 26th, 2009

In part 1 of this article, we discussed some alternatives to handling a user login object that is controlled by a legacy application framework outside of Spring. We also discussed some disadvantages with our approach. (more…)

Using Hibernate Validator for your Java classes

Friday, June 12th, 2009

This article discusses how to use the Hibernate Validator for your Java classes. (more…)

Managing legacy user login object with Spring (Part 1)

Sunday, June 7th, 2009

Using Spring to manage your Java beans for dependency injection is fairly straightforward, but what do you do when you want Spring to manage beans that were created outside of the Spring container? I encountered this issue on a recent project. The user login credentials were handled by a legacy system and stored in the HTTP session. (more…)

ClassNotFound errors - Hibernate 3.1 and Spring 1.2

Sunday, June 7th, 2009

I recently had a project that incorporated Hibernate and Spring. MyEclipse 5.0 was the IDE, and the app server was JBoss 4.0.4. We encountered a few problems trying to get the correct combination of Hibernate, Spring, and JBoss that would play well together. (more…)

Sorting data in Java using Apache BeanUtils

Thursday, May 21st, 2009

Most data driven applications have a requirement to be able to sort data. Most of the time this can be accomplished at the data access layer by sorting the data when it is retrieved via SQL query, or by using JavaScript or some other scripting language to sort the data in the view layer. However, there are also times when it is convenient to sort a collection of POJOs in the business layer. (more…)