Java Comparator Example
Java provides in built support for sorting a list of primitive types… with something like Collections.sort(list). Unfortunately things are not as simple for sorting a list of non-primitive types, since the java collections class doesn’t know exactly how to sort this type of list… let’s take Customer for an example….
Continue Reading Add comment June 30, 2009
Anti-Aliasing in Netbeans
For some time now, the newer version of netbeans, no longer displays the “Advanced Options” that allows for anti-aliased fonts.
Continue Reading Add comment June 10, 2009
DisplayTag & alt=”"
Currently DisplayTag (ver 1.2) does not support the html ‘alt’ attribute… which can be quite annoying at times ! Nonetheless, there now seems to be a way around this…
Continue Reading 2 comments May 27, 2009
JSTL to Java Scriplet
When you want to use an EL variable exposed by a JSTL tag in an expression in the page’s scripting language, you use the standard JSP element jsp:useBean to declare a scripting variable.
Continue Reading Add comment March 26, 2009
org.hibernate.AnnotationException: @OneToOne or @ManyToOne on xxx references an unknown entity: xxx
During the process of converting the old hibernate xml heavy structure to the new annotation based structure, the following error was encountered after annotating one of the entity files…
Continue Reading Add comment January 22, 2009
Introduction to Hibernate Annotations
Simple article that describes the minimum steps required to convert a hibernate (and spring) project to start using hibernate annotations.
Continue Reading Add comment January 8, 2009
Exception: [.TableTag] Unable to reset response before returning exported data.
When displaytag exports data in any non-html format, it needs to change the content type returned to the browser and reset any other content generated by the surrounding page.
Sometimes this can’t be done: if content has already been sent back to the user, the response can’t be reset and you get an error. This could happen because too many chars have been already written to the response, so that the response buffer was full and response has been automatically flushed.
Continue Reading 8 comments September 3, 2008
Using i18n in the Spring Controllers
This article, in brief, highlights the steps required to make use of i18n (internationalisation) within the controllers (or any other *.java files, for that matter) for an application making use of the spring framework.
Continue Reading Add comment July 4, 2008
Operator Precedence in Java
In an an attempt to print the value of an entity; carelessness in terms of operator precedence can lead to surprising results….
Continue Reading Add comment June 17, 2008
Javascript Tip: ‘Number()’ function
Trying to do a simple number comparison, can be surprising in javascript sometimes. For example…
Continue Reading 4 comments June 11, 2008