• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Form Beaners Compared?

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm looking for a somewhat concise comparison of the different methods of form bean creation, and the scenarios to which they're best suited, respectively. I'd also like to consider third party ones, such as LazyDynaBean, LazyValidatorForm, etc.

Does anyone have a bookmark at their fingertips, or can differentiate them in brief?

Thanks,
Jamie
 
Jamie Jackson
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, I guess that's a tall order. Let me ask a more specific question:

Say I have a form that has some beans as properties:


Does this necessitate a ValidatorActionForm, or can I still use a DynaValidatorActionForm?

Thanks,
Jamie
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use the dyna version and specify your contact object as on of the form's properties.
 
Jamie Jackson
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Marc.

Question 1: Is this how one would do this one little piece?
jsp snippet:
<html:text property="contact.email"/>
<html:text property="contact.firstName"/>
<html:text property="contact.middleName"/>
<html:text property="contact.lastName"/>

struts config snippet:
<form-bean name="grantForm" type="org.apache.struts.action.DynaActionForm">
<%-- is the following (1) line necessary? --%>
<form-property name="contact"
type="com.myFirm.performancemeasurement.ContactPerson" />
<form-property name="contact.firstName" type="java.lang.String" />
<form-property name="contact.middleName" type="java.lang.String" />
<form-property name="contact.lastName" type="java.lang.String" />
<form-property name="contact.email" type="java.lang.String" />
</form-bean>

Question 2: Is there a limit to the amount of nesting? I ask, because my contact has, in turn, a phone number, which is itself an object:
contact.phone.countryCode
contact.phone.number
contact.phone.extension

Thanks!
Jamie
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic