Struts 2 and Fluent APIs

At work we use Struts 2 for a lot of internal applications. Lately, we have started to code a lot of our business objects in a fluent style (beans that return a 'this' reference in every setter). We were working on an application this past week that used both Struts 2 (2.0.11) and a fluent API, only to find out that the two are not compatible. The issue resides in OGNL, which is what Struts 2 uses to set bean properties upon a form submission. As of this writing, Struts 2 requires OGNL version 2.6.11. Fortunately, after some searching, we found the issue in OGNL's JIRA tracker. The solution? Upgrade to OGNL version 2.7 or higher. So far, we have seen no compatibility issues between Struts 2.0.11 and OGNL 2.7.

Leave a Reply