You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Greg Lindholm <gl...@yahoo.com> on 2008/04/23 21:36:42 UTC
[OT] Looking for a util to set parameters on an object
I have an object and a Map of parameter/values and I'm looking for a utility that will match up the parameters with the setters on the object, call the setters and handle conversions for primitive types.
I know that OGNL is being used to do this on actions from the ParametersInterceptor. I tried tracing this down in the debugger and it seems to be way more complicated then I need (i.e. uses a value stack and a context and support full OGNL expressions etc.)
Is this facility available in a (simple to use) standalone utility?
I could write it but why re-invent the wheel since I'm sure it exists already.
Thanks
Greg
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
Re: [OT] Looking for a util to set parameters on an object
Posted by Adam Hardy <ah...@cyberspaceroad.com>.
Greg Lindholm on 23/04/08 20:36, wrote:
> I have an object and a Map of parameter/values and I'm looking for a utility that will match up the parameters with the setters on the object, call the setters and handle conversions for primitive types.
>
> I know that OGNL is being used to do this on actions from the ParametersInterceptor. I tried tracing this down in the debugger and it seems to be way more complicated then I need (i.e. uses a value stack and a context and support full OGNL expressions etc.)
>
> Is this facility available in a (simple to use) standalone utility?
>
> I could write it but why re-invent the wheel since I'm sure it exists already.
org.apache.commons-beanutils
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [OT] Looking for a util to set parameters on an object
Posted by Volker Karlmeier <vo...@magiccode.eu>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
ognl isn't that complicated as it seems. Look at
http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/index.html
If you don't like it, try using java.reflection-api ;)
Greg Lindholm schrieb:
> I have an object and a Map of parameter/values and I'm looking for
> a utility that will match up the parameters with the setters on the
> object, call the setters and handle conversions for primitive
> types.
>
> I know that OGNL is being used to do this on actions from the
> ParametersInterceptor. I tried tracing this down in the debugger
> and it seems to be way more complicated then I need (i.e. uses a
> value stack and a context and support full OGNL expressions etc.)
>
> Is this facility available in a (simple to use) standalone utility?
>
>
> I could write it but why re-invent the wheel since I'm sure it
> exists already.
>
> Thanks Greg
>
>
>
> --------------------------------- Be a better friend, newshound,
> and know-it-all with Yahoo! Mobile. Try it now.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFID5emx4KjH6Tk4MMRAmJjAKCwL+eeklZBILI7DA/h1/oaM9LeIACcCCKR
qQTgQC9htFCxTLHxgCIpeHs=
=yYzt
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org