0

Going through this little tutorial for creating a simple CRUD page with JSF, I stumbled over the Bean definition there. In that article, a Bean is defined as an Object that implements Serializable and consists of a List and a POJO instance, getting its content from the DAO. Now for my other servlet operations, I already had created POJOs and respective DAOs for database operations; but I thought the "Bean" was the POJO with its getters and setters, modeled to be consistent with the DB. If I get the tutorial right, now I should have "another bean" for every Bean I already created to be able to use JSF, correct?

(seems somehow redundant, esp. the usage of the term "Bean" here, if I got that right)

cirko
  • 211
  • 2
  • 13
  • You can just reuse your existing "POJO"? I'm not really understanding your concrete problem with that, so I'll do an educated guesses that this answers your actual question: http://stackoverflow.com/questions/30639785/jsf-controller-service-and-dao – BalusC Oct 26 '15 at 09:32
  • @BalusC Ah, the author himself, thanks... :) Well I have literal POJOs consisting of getters and setters only; they correspond with the "Item" objects in your tutorial. And I have a DAO for every one of them to do the SQL stuff. But according to [this definition](http://docstore.mik.ua/orelly/java-ent/jnut/ch06_02.htm), I thought that these POJOs were the "Beans"; in the tutorial, the "Beans" are Handlers/Wrappers using the Item POJOs that _I thought were Beans_, so this confusion of terms confused me, too. But anyway, it works, and that's the main thing! Thanks for that! – cirko Oct 26 '15 at 11:06
  • OK, thinking aloud, this means I can expand my POJO I thought was a Bean with the functions you propose in the tut and it should still work as both, as the POJO it was before and as the Bean for JSF... thanks, that answers it – cirko Oct 26 '15 at 11:24

0 Answers0