That's a very interesting thought, one I can't say has ocurred to me before... I'm not aware of any existing code to do that, and if nothing exists I think it's ripe for being created. I wouldn't mind working on it myself!
The idea of essentially being able to serialize a Javascript object and reconstitute it as a Java object (and vice-versa) is a fascinating thought indeed. If you find anything if you wouldn't mind, please let me know directly ([EMAIL PROTECTED]) because if nothing exists, I may well get to work on such a beast! -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Fri, October 29, 2004 1:07 pm, Ed DeMaio said: > I have a javascript object that I store in a hidden form field. It > seems to be submitted to the servlet as an array of strings, where the > indices are the values of the properties of the javascript Object. > > Basically I'm wondering how I can have a javascript object mapped to a > java object, instead of simply into an array of strings. It seems to > have something to do BeanUtils.populate(), but really I'm not sure. If > anyone can even point me in some vaguely helpful direction it would be > much appreciated, as I have been searching for days. > > > > Below is an example in case my description was unclear... > > my jsp file includes: > > <script type="javascript"> > var test = new Object(); > test.property1 = "qwerty"; > test.property2 = 7; > > window.onload = function() { > document.getElementById('form1').test.value = test; > } > </script> > > <html:form styleId="form1"......> > <html:hidden property="test" styleId="test" /> > <html:submit property="submit" /> > </html:form> > > > my ActionForm class contains the following getter and setter method: > > public TestObject getTest() { return testObj; } > public void setTest(TestObject test) { this.testObj = test; } > > > and my TestObject class contains the following getter and setter > methods: > > public String getProperty1() { return prop1; } > public void setProperty1(String s) { this.prop1 = s; } > > public Integer getProperty2() { return prop2; } > public void setProperty2(Integer i) { this.prop2 = i; } > > and when the form is submitted, i would like the test object in my > action form populated with the properties from the javascript test > object that was submitted. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

