• 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

Problem using logic:iterate

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hii,

i am a newbie to struts...currently using 1.1 version...i was trying to retrieve the data from database onto my jsp page but am having trouble...please help me out...i have a database and i have to retirve values form there into my jsp page ...here is what i am doing..
Action Class



The java bean is


and jsp is


On executing this i am getting error
No getter method for property ProposerID of bean collection


Please help me out.....
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The property is "proposerId" (note that the first character isn't capitalized).

I'm almost positive this isn't how you want to do it though--you're creating a collection of ActionForms. Normally there's a single ActionForm per action, and the ActionForm is passed automatically to the JSP. In y our case you'd have a list of users in the ActionForm, not a list of ActionForms.

(There is some debate whether or not ActionForms should be used solely for form data, or for *any* data for use on the page--I am of the former camp, but that's preference.)
 
patriot indian
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey thanks for the quick reply...but can you tell me how to solve this problem ...i need to get the entries from the databse into my jsp page...how exactly we will do that...currently i am able to pass the object into the arraylist...now i need to get the attributes(methods) to display them on the jsp...
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should be able to either add DB entries to a list (an array should also work) in an ActionForm, or create a separate collection and put it into request scope. From there use <c:forEach> (recommended) or if you're not using JSTL <logic:iterate>.
 
patriot indian
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you show me a bit of working some pseudocode sort of thing so that i can use it..

Thanks in advance....
 
Something must be done about this. Let's start by reading this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic