Craig R. McClanahan wrote: >>Subject: Re: Creating beans dynamically from byte code in a byte[] with >ClassLoader.defineClass - how to do it right? >>From: "JM" <[EMAIL PROTECTED]> >> === >>Absolutely, how did ya do it? > > > One approach to dynamic class generation would be to use the BCEL package > at Jakarta: > > http://jakarta.apache.org/bcel
Which was what I ended up doing, with a syntetic class name based on the MD5 sum of the field names and types. > A second option is to take advantage of the new DynaActionForm > capabilities in Struts 1.1-b1 -- you declare the form bean properties in > struts-config.xml and don't actually have to write the form bean class > unless you need a custom reset() or validate() method. Even if you do > need those, they are the only methods you have to write. I wanted something that was able to "beanify" a JDBC ResultSet, without any external configuration what so ever, in order to basically return a SQL-query as an ArrayList of Beans. I am just wrapping it up so I can start using it for populating our search forms (we basically need to do up to 10 seperate SQL-queries to populate all our drop down boxes), and then I need a permission to publish what I wrote - unfortunately that might take some time, but I expect I will be allowed to, and then I will submit it for Jakarta. -- Thorbjoern Ravn Andersen Scandiatransplant, c/o Christian Mondrup 89 49 53 01 http://biobase.dk/~tra -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>