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…)
Posts Tagged ‘Java’
Iterate over a Map using Java 5 generics
Sunday, August 2nd, 2009Managing legacy user login object with Spring (Part 2)
Friday, June 26th, 2009In 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, 2009This 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, 2009Using 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, 2009I 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, 2009Most 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…)
Using Google JSON with Prototype and Java
Friday, April 10th, 2009Widely hailed as the successor to XML in the browser, JSON aspires to be nothing more than a simple and elegant data format for the exchange of information between the browser and server. In this example we will learn how to create a JSON object on the client using JavaScript (and Prototype), and how to process that same JSON object on the server using Java. The examples use the Google JSON (or GSON) libraries for the JSON parsing.
(more…)
