Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

No getter method for property name of bean userList

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • 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: 15929
265
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
  • 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 ]
 
What does a metric clock look like? I bet it is nothing like this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic