I'm currrently working on a project in which we are pulling a set of value objects back from a data server and displaying the attributes of these objects in a JSP. The framework I am using is Struts 1.1.
The value object's attributes are mostly custom typesafe enums (see Effective Java, Bloch, p105) that Struts doesn't have a clue how to handle, as you'd expect.
Currently I am 'wrapping' the returned objects into a composite object that contains the returned value objects and provides me with accessor methods that convert the enums into Strings for displaying.
Although this is a quick and easy fix, does anyone have any suggestions on a more flexible approach? i.e. something that doesn't require me to write one wrapper class for each set of value objects returned. I've heard mention that a data dictionary might be useful, in which I map the contents of each value object within an XML file that defines the type of each field. I could then use a generic class to handle each object according to the definitions in the dictionary.
Can anyone point me to an example of this kind of solution?