Struts2-Interceptors-Extension Library

June 19, 2012

A bundle of interceptors which extend the existing built-in interceptors of the Struts2 framework with some additional features helping development and support of Struts2 applications.

Check github out for source and info.


PropertyManager Utility on GitHub

June 7, 2012

A Java utility for managing property files:

  • simple
  • open source ūüôā
  • Mavenized
  • Unit tested

Custom indexing (using Java threads) with Hibernate Search

April 28, 2011

The post is based on latest development on a project:  the requirement is to implement a custom incremental update of the Lucene index. The update takes place at pre-defined (configurable) intervals and indexes all entities created or modified since the last run (i.e. full text search index is aligned with the DB changes every 60 min while the users are accessing the application)

The technology stack is Hibernate 3.6, Hibernate Search 3.3, Lucene 3.0.1, Spring 2.5.6, Java 5.

Why and How

Read the rest of this entry »

Test Driven Development (TDD) Masterclass – Amsterdam

September 27, 2010

On Sep 15/16/17 I had the great opportunity to attend a Test-Driven Development (TDD) Masterclass together with Robert C. Martin (Uncle Bob) of Object Mentor.

The event was arranged by Zilverline, a young Amsterdam-based company specialising in Agile consultancy and training. The folks of Zilverline did a great job: training location was superb as they were the facilities and their support though out the event.

I think it hardly gets more interesting that digging into the deep secrets of TDD, especially with one of its greatest preachers. The 3 days were just enough to go through the approach of TDD, when/how to do it, obstacles and enemies during the implementation  and what you really want to achieve.

The audience was pretty advanced, everybody bringing real hands-on experience mostly with TDD or at least with development and testing enterprise software. Great chance to discuss/compare/challenge different ways of working with experienced developers/techies… which is (based on my experience at least) very rare in most trainings.

Read the rest of this entry »

RSS Feed with Basic Authentication in Apache Tomcat

June 13, 2010

This is just a summary of a small project I got lately involved in: creation of a RSS feed which authenticates the user upon access.

This has a variety of applications:¬† most RSS feeds on the Internet are public stream of information (news, blogs) but in an enterprise environment that’s not really an option, information is confidential and must be delivered to users according to well established privileges and security rules.

Read the rest of this entry »

Struts2 Static Content

November 6, 2009

In the Apache Struts2 Documentation Performance Tuning page one of the recommended tips for improving the performance of the framework is to avoid Struts serving the static content.

Struts tags and themes include a set of static resources – javascript libraries, CSS, Freemarker templates – which are included inside the Struts jar file. The framework, via a filter (org.apache.struts2.dispatcher.FilterDispatcher which then delegates to a “staticLoader” class), retrieves those resources from the jar files (unjar them on the fly) and serves them on request.

Although this works quite neatly – nice to have all classes and resources contained together – it adds an unnecessary overhead upon serving the http request.

Read the rest of this entry »

Using FreeMarker in a JSP taglib

September 6, 2009

Simple steps to create a JSP taglib which (internally) uses the FreeMarker engine for generating the output .

The JSP taglib is responsible for defining the name, attributes and behavior of the tag whilst the generation of the output (i.e. html code, predefined text template) is delegated to the FreeMarker engine.

This technique brings various advantages such as the separation of responsibilities (“presentation-designer” vs “business-programmer”), better maintenance and extendibility.

The approach is similar to the Struts2 JSP tags: this is just a simpler implementation to see what happens behind the scene.

Read the rest of this entry »