----- Original Message -----
From: "Dave Newton" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Wednesday, June 06, 2007 1:14 PM
Subject: Re: [S2] decoding values of objects properties
I'm still not entirely what you're decoding from and
to; it sounds like something is fundamentally broken,
but...
Ok, I explain: suppose we have an entity with a state property that can
assume values 0, 1 where 0 stands for "Active" and 1 stands for "Not
Active".
state is the property name
0 is the value
"Active" is the "decoded" value
It's often useful (at database level) to map certain properties to numbers
(or strings, or whatever) which belongs to a description in metadata, so it
is possible (for example) to change the description without any side-effects
on old stored data.
(Joining the table to retrieve the decoded value is not an option when the
metadata table is shared through many sets of values and not dedicated to a
precise field or table (it should be joined too many times): it is best
effective to store metadata in memory and pick values from it.)
Remember that with OGNL you *can* call arbitrary
methods, including static utility methods, from with
the EL. So with either a static decoding class or
(preferably) a service object in your action if you're
iterating over a list you can call methods on items
from that list.
d.
Ok, so it seems I'm missing some OGNL features: if I can call a method of an
Action that accept parameters in input then this is the solution. I'm going
back to study and find how to.
Many thanks,
P.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]