• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

No getter method for property name of bean userList

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a login form that leads to another action form.
This populates an Arraylist from database and puts in request
ArrayList userList = getUser();
request.setAttribute("userList",userList);
When i try to access values from action-class , all values from database are printed as well.
I have following code in jsp:
<logic:iterate id="userList" name="userList" scope="request" >
<bean:write name="userList" property="name" />
</logic:iterate>
I get folowing error :
No getter method for property name of bean userList
Any clue?
 
Sheriff
Posts: 17687
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You choice of names is not exactly ideal. getUser() should return a list whose elements are objects that have a getName() method. To improve readability, I suggest that you write something like:

This results in logic that in effect does this:

The italicized code won't work as is but is what effectively happens.
[ August 27, 2003: Message edited by: Junilu Lacar ]
 
Curse your sudden but inevitable betrayal! And this tiny ad too!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic