Archive for February, 2012

Injecting Spring Beans into Java Servlets

February 23rd, 2012

If you are working in a Java Web Application and you are using Spring IoC Container in your application, there is a chance that you might have to inject Spring Beans into a Java Servlet.

Since there is not a direct way to inject Spring Beans into a Java Servlet, you might try to lookup the Spring Beans from the Spring Context within your servlet and assign the dependencies which means that part of injection would no more be IoC and you would be looking for some concise way of doing this.
» Read more: Injecting Spring Beans into Java Servlets

Static Caching in Drupal

February 6th, 2012
If you’re a PHP veteran, then you know static caching is a relatively simple thing to do in PHP, but it can result in inconsistent behavior and sloppy code, such as adding an extra parameter to a function for the sole purpose of resetting that function’s internal cache.

Drupal’s static caching system improves upon the old way by providing a simple and consistent way for creating your own cache store and resetting cache stores set by other systems within Drupal.  The entire functionality of this system is wrapped up in the drupal_static() function, with a side function, drupal_static_reset(), for resetting any existing cache store.
» Read more: Static Caching in Drupal

Hibernate Date vs Timestamp

February 2nd, 2012

I encountered a subtle hibernate mapping issue involving Dates and Timestamps. The following test recreates this issue.
» Read more: Hibernate Date vs Timestamp