The AMSeT Project Blog

Friday Sep 25, 2009

Bean Soup and Spring Bananas

I've been driving a NetBeans Hacker automatic for too long now to go back to a manual shift. At the click of a mouse I can write 20 getters and setters at a time. And these little getters and setters let me use yet more tools to pull apps together. Spring is one such. Alfresco's AMP extension modules require Spring to wire into the main application.

Databinding in the view layer in SpringMVC requires that Java objects have the Bean getter/setter structure. There is a nested class structure running down the SWORD "common core" spine ServiceDocument.Service.Workspace.Collection... Spring can see Java fields OK until it burrows down to Workspaces and Collections where it goes bananas (eh?) when the Bean structure is broken. For example, the Workspaces getter returns an Iterator and the setter uses a List.

This means that Spring and other tools can't be used directly to bind to display fields in the view layer. This might be something to consider if SWORD is to be developed further.

There's always another way. One obvious solution is to write <%...%> Java code in the jaspers and talk to the objects directly. But, old-fashioned as I am, I'm not that old-fashioned. Another way would be to write a tag library, but in a stocking-filler workpackage, I thought better of that. What I have done is create mini AmsetWorkspace and AmsetCollection objects in which The Canonical Bean is restored. I should get away with that.

Calendar

Search

Navigation