Java, Web Applications

Learning Struts

In my new job I have been having to catch up on a lot of web tier technology that quite frankly I have not had much to do with for the last two years of Swing and EJB. I looked at Struts two years ago while doing an intranet application and thought that it was very heavyweight and would add to the development not subtract. However I did adopt the Front Controller idea along with the idea of views (although I think I may have munged the Models, I can’t remember now).

My first experiences with Struts was very poor, it was everything I feared it would be. Heavyweight, huge learning curve, lots of coding, all the code having to be completed up front before you could test things like the URL mapping. Everything you try to avoid in web programming these days!

In addition all the books and documentation I have been reading give a very poor idea of how to implement basic web applications with Struts. They present a very particular view of how Struts should be used and instead of focussing on the Front Controller pattern and the decoupling of components they tend to focus on gathering up and validating user input.

However today I felt like I had a breakthrough. I was trying to get a DynaBeanForm to work and I suddenly noticed that my MyEclipse XML editor was not presenting the options I was expecting from the documentation. A sudden brainwave and I was checking the DTD definition. Sure enough someone had upgraded the Struts code to Version 1.1 but left the DTD at 1.0. Cue much misery on my part trying to figure out how things were meant to be put together.

With DynaBeans and DispatchActions up and running I probably found myself being more productive in the last 12 hours than I was in the previous week.

The jury is still out on Struts for me but I have realised that I can’t take too much from just one experience of a product, particularly in an installation you haven’t been involved with.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s