Java EE 6 - JSF Controllers

I start with Java EE 6 after not touching EE for many years (I have been in Spring country for some time).

In JSF 2, I correctly understand that we actually do not have controllers. Is this work done using managed beans?

If so, is it considered common practice to then introduce the "Service" class (with CDI) into my managed bean to handle business logic (and subsequently call DAO)?

I bought a book (PacketPub "EE 6 with Netbeans") and read a lot of tutorials, but I still don't understand a bit how to do it right.

As a bonus question, is there a link for the “PetStore” style app that I can download that shows that all this is connected to each other in the best possible way?

thank

+3
source share
1 answer

In JSF 2, I correctly understand that in fact we do not have controllers anymore. Is this work done using managed beans?

It depends on how you define the term controller. Some people confuse managed beans with controllers, but they most likely belong to the model part of MVC or are “between” the model, view and controller (see this excellent answer by Arjan Tijms for a similar question).

If so, is it considered common practice to then introduce a “Service” class (with CDI) into my managed bean to handle business logic (and subsequently call DAO)?

( ). , , , , , bean CDI bean (.

. . .

+3

All Articles