I tried this out weeks ago so I've forgotten some of the details, but I think the way it works is, if you decide to wrap your pojo with WrapDynaBean, your form's fields are limited to what your pojo has.
<form-bean name="updateProfileForm" type="ie.jestate.input.ProfileDTO"/> If you want to define forms based on your pojo, and still add form-specific fields, check out formdef: https://formdef.dev.java.net. Btw: (1) the "https://www.jestate.dev.java.net" in your sig doesn't work -- take out the "www." (2) you can find mail archives at http://marc.theaimsgroup.com/?l=struts-user&r=1&w=2 (3) a user has already reported that FormDef is compatible with StrutsTestCase, though I haven't personally tried it yet Hubert On Tue, 9 Nov 2004 19:36:48 +0100, bryan <[EMAIL PROTECTED]> wrote: > Ok , I admit I may have lost the plot somewhat/somewhere ... but am I > on the right track at all here ? Also I just signed up to the list and > caught the last post about VO but the answers aren't archived anywhere > yet. Would appreciate if someone forwarded me that conversation. > > In my struts-config.xml file > > <form-bean name="updateProfileForm" type="ie.jestate.input.ProfileDTO"> > <form-property name="username" type="java.lang.String" /> > </form-bean> > > In my strutstestcase class .... > > ProfileDTO profileDTO = new ProfileDTO(); > > profileDTO.setUsername("bryanhunt"); > > BeanValidatorForm beanValidatorForm = new BeanValidatorForm(profileDTO); > > setActionForm(beanValidatorForm); > > actionPerform(); > > and in the action itself ... > > BeanValidatorForm beanValidatorForm = (BeanValidatorForm) form; > > logger.debug(form); > > WrapDynaBean bean = (WrapDynaBean) beanValidatorForm.getInstance(); > logger.debug(bean.getInstance()); > > but the username field is null ...... > > Am I on anything like the right path here ? I want to pass the POJO > straight to my service layer after struts validation. I know this > stuff has just been added in so I'm not really finding much > documentation on it. > > If anyone can point me in the right direction I would be happy to add > a page to the wiki. > > Thanks > > Bryan Hunt > -- > http://www.revoltingdigits.com > https://www.jestate.dev.java.net > > --------------------------------------------------------------------- > 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]