28 7 / 2009

Fixed Header Table using jQuery

This is yet another jQuery plugin to provide fixed headers for tables. It differs in the way that it does not require any odd html table semantics. It just needs a TABLE tag with THEAD and TBODY to work its magic.

How it works?

Simple.  It takes a TABLE, pulls the THEAD and TBODY out of it and puts them into two separate  DIVs.  Now, the DIV which THEAD (header-div) goes is overflow restricted.

Read More

26 6 / 2009

Auditing using Interceptors in Hibernate

This would probably work only in Hibernate 3. Its loosely based on https://www.hibernate.org/48.html. I am showing a very basic example which sets the created time in a property when an entity is inserted and the updated time in another property when its updated.

Hibernate allows interceptors to be registered and calls it when an entity’s state changes during its lifecycle. Refer the Interceptor documentation for information on its methods. The method names give you an idea of when it gets called.

Read More

Tags:

Permalink 14 notes

05 4 / 2007

Authoring Custom Namespaces in Spring 2.0

This post is a republish of the article I wrote for TheServerSide.com. You can find it here.

Starting from version 2.0, Spring supports XML Namespaces. The purpose of this article is to discuss the new XML schema based configuration available in Spring 2.0. Familiarity with previous versions of Spring and basic AOP terms is assumed. Spring now supports and recommends usage of XML Schema rather than DTD. As users of previous versions, you might remember using the <bean> tag and its structure being declared in a DTD. Instead, this is now declared in a XML schema (spring-beans-2.0.xsd). Rest assured, the DTD configuration is 100% legal and is fully supported in Spring 2.0. DTD has its limitations and modern IDEs encourage using XML schema to fully utilize features like auto-complete that comes handy during XML authoring. In the old-fashioned bean style configuration the developer has to know the name of the appropriate factory or proxy beans. Everything is a bean with a proxy or factory class and a different set of attributes. Transaction, caching, security etc are implemented using appropriate proxy classes and configured using the properties in XML. This makes the XML verbose and it also exposes the internal classes of Spring. These factory or proxy classes are never called in the code directly. It makes perfect sense to hide them from the developer – one of the reasons for the shift. Schema based configuration greatly reduces XML plumbing and eases authoring.

Read More