Re: Populating Options in ActionForm

Vic Cekvenich <[email protected]> Fri, 11 Jul 2003 11:29:05 -0400
Newsgroups gmane.comp.java.mvc.devel
Organization baseBeans Engineering
Message-ID <[email protected]>
Best practice is to unit test!
The FormBean should not know how the data gets there. OptionCollection 
requires a Collection returned. So you need to unit test your form bean 
for returning a collection.
Ex:
public Collection getOptions() {
...
}


Qasim Khawaja wrote:

> I am trying to populate three drop down selects with data from the 
> database (well actually using a DAO class and hibernate). The DAO 
> class throw a hibernate exception. I don't obviously want there to 
> make the ActionForm aware of hibernate.
>
> What is the best way to populate the lists in the ActionForm?
>
> Thanks Q
>
>
>

-- 
Vic Cekvenich,
Struts Instructor,
1-800-917-JAVA

Advanced <a href ="baseBeans.com">Struts Training</a> and project recovery in North East.
Open Source <a href ="baseBeans.com">Content Management</a>  basicPortal sofware
Best practice<a href ="baseBeans.com">Struts Support</a> v.1.1 helper ScafflodingXPress