I am trying to learn web development with JSF by myself. There are planty of sources to learn about this and that but I am having hard time binding them all together.
Imagine I have a database with a table called user which have columns: id, name, surname. I am using JPA in my project so I have a class with @Entity annotation, which is mapped to this class. I also have an index.xhtml, in which I have a Registiration Form with username and password fields. So when the user clicks the REGISTER button, I should check if a user with same username exists, if not, I should register the user and redirct the user to welcome.xhtml. If registiration is unsuccessful, then user should stay in index.xhtml.
My questions are:
I have an index.xhtml, and a UserEntity.Java. But what else? Do I need a RegistirationFormBean which is a @ManagedBean? And this RegistirationFormBean will have a registerUser method with. Then what? Do I have a RegistirationFormControllerBean? Should it be a ManagedBean as well? Or do I need a UserRegistirationBean? UserRegistirationService?
So how do I create the MVC properly?