More action with Struts 2

how-to
Jul 13, 20083 mins

Got my hands on this Struts 2 in Action book recently. One year ago I had to choose the right web application framework for a project. And of course it was one of those crazy projects that were behind the schedule even before their official launch. In one year of Struts 2 I can definitely say that Struts 2 in Action is the right book for those who need to start learning Struts 2, and I can only wish I had it by the time our project took off. Struts 2 in my mind is an undervalued framework that still has a lot of potential. Fortunately its popularity keeps constantly growing as Google trends show. The funny thing about Struts 2 is, in my mind, Webwork being its strongest asset. In fact, Struts 2 is just a collection of extensions built upon Webwork. And I just loved the fact that Struts 2 in Action book follows that exact pattern and is build upon the Webwork in Action book. Webwork is ultimately the right thing to learn before starting a Struts 2 project. Struts 2 is an open source project, in Apache style. This means that: 1. You, as well as other (random) developers, might take part in fixing its issues and introducing new features 2. Developers are prone to mistakes One of Struts 2 mistakes was packaging of Web 2.0 features (the whole Dojo 0.4 framework) into the single Struts JAR file. Dojo 0.4 became outdated very fast, and Struts 2 Web 2.0 built-in features will now seem archaic for a freshly started project. Another big mistake was that catastrophic issue that was fixed by the cruel disabling of (commonly used) JSTL EL in all of the Struts 2 custom tags! What it really means for a real-life project? A complete rewrite of JSP pages that depend on JSTL EL. Or, hacking the Struts 2 JARs. Or, sticking to the last working Struts 2 version 2.0.9, which was our case. Fortunately, Struts 2 in Action avoids both problems. It doesn’t discuss Dojo-related topics, nor it mentions a possibility of JSTL EL in custom tags. The book actually tries to discuss JSON operations, but in a completely misleading form. Instead of just dropping JSON Plugin into Struts 2 stack authors recommend to write custom JSON handler, which doesn’t make any sense. It is very strange, since one of the book authors is actually developing another Struts 2 plugin – REST Plugin, which will hopefully be widely used once Struts 2.1 is out. To wrap up – Struts 2 in my mind is a powerful web application framework with wast of integrated stuff, which can save your (hopeless) project. Struts 2 had a certain amount of architecture flaws, but its core – Webwork – is well-designed, well-tested and reliable. Struts 2 has a great potential to evolve into something great, and I hope version 2.1 will rise and shine sometime very soon. And, Struts 2 in Action is a valuable book giving you a good understanding of Struts 2 core.