• 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

Struts Design Consideration for LabelValueBean

 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy Ranchers,

I am currently working on populating a dropdown from a list of school id's and I am not sure if returning a list of LabelValueBean from Data Access Layer is a good approach? What I mean to say is, I have a application which follows EJB architecture where entry point is the Struts Action or the Command class followed by the Business Delegate-> EJB-> Application Service -> DAO - DB. Now in the DAO layer, I have a query to which I pass the list of school id's and it returns me the filtered list of schools which are present in the Database along with their name. So I have a School Name and School Id which I would like to put into LabelValueBean("schoolName","schoolId") and then returning it to the action, set it into Session / Request attribute and then populate the dropdown using .

Is it preferable to return a list of LabelValueBean from the DAO layer like:



Please help me out on the same.

Thanks,
Yogendra
 
Ranch Hand
Posts: 93
Python Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use any value object from your model layer which has the fields with getters and setters.

For eg.,


Just mention the label and value properties in labelProperty and property attributes respectively.

 
reply
    Bookmark Topic Watch Topic
  • New Topic