• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No getter method for property name of bean userList

 
Sanjay Deshpande
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?
 
Junilu Lacar
Bartender
Posts: 7607
54
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic