Struts2 + Hibernate + Spring

22 January, 2008

At work we’re playing with creating a personal-homepage application in the style of iGoogle and others. We’re a Java shop, using pretty basic JSP+servlets+Hibernate as our standard application development structure. Since when we formed we were quite a varied team in skillset this has meant that everyone is now more or less equally versed in core Java web app development.

We’ve used this opportunity of writing a new application to try out a number of ways of reaching that goal – specifically we broke in to three teams of two, wrote up a very basic requirements spec (“drag and drop panels and remember the positions”, “show an RSS feed”, “use single-sign on”), gave ourselves three days for implementation and chose three methodologies. In fact, we chose three different languages!

One team looked at using Symfony, another team looked at Ruby on Rails and a colleague and I looked at using “a Java framework”. I didn’t want to choose anything too complicated or with too-steep a learning curve (we had to be able to actually achieve our requirements!) and went very quickly through about six or so before settling on Struts2 as looking like a clean, well-separated development framework. This turned out to be the right choice for the job.

The quickstart application we downloaded from the wiki came with everything we needed to get going. It uses Hibernate as an EJB3 persistence layer (using POJO annotations) and uses Spring to inject the session management whenever it’s required. It also came set up as an Eclipse Tomcat project which deployed instantly.

We only really scratched the surface of what’s possible, but overall I was very impressed with this combination of tools and additions like the REST plugin. In particular, using annotations to power the persistence was a revelation, as previously I’ve maintained the hibernate.cfg.xml and mapping files, which are terrible. This does mean that we no longer get support from Hibernate tools like hbm2ddl, but it’s a small price to pay.

See other posts tagged with general java and all posts made in January 2008.


27 March, 2008 at 18:03

Hi, I tried to read the specs, but it seems that is not available. Is it possible that you post it, please? Thanks

28 March, 2008 at 19:46

Someone’s changed the page permissions. I’ll ask about getting it opened up again, thanks for the heads up.