This week's book giveaway is in the Testing forum.
We're giving away four copies of Data Structures the Fun Way: An Amusing Adventure with Coffee-Filled Examples and have Jeremy Kubica on-line!
See this thread for details.
  • 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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....
 
Pay attention! Tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic