Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why Managed bean entry for Arraylist in faces config?

 
karthik manick
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i am confused with this thing...if we are using arraylist , where shd we map that? under managed property or managed bean? if in both places why?mapping under managed property itself not enough? Please clarify...
 
Akaine Harga
Ranch Hand
Posts: 99
Java MyEclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While all tutorials say that you should set every damn attribute as managed bean property in faces-config, you shouldn't. Just declare the managed bean itself and then you can use its properties in template like that: #{myManagedBean.myListProperty}
 
Tim Holloway
Bartender
Posts: 18420
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since managed beans are POJOs, you could theoretically declare a managed bean of class java.util.ArrayList and use it. But it would probably be pretty awkward. More often, you'd embed the ArrayList is some other bean and use that instead, with the ArrayList being one of the properties of the containing bean. That's actually quite common.
 
karthik manick
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tim and Akaine ..
 
To do a great right, do a little wrong - shakepeare. twisted little ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!