This content has been marked as final. Show 2 replies
This is not a "classic" java application, it is a web application. The application that has the main() is the actual container you're using (Tomcat, Glassfish, etc.). So that's where it all begins - you start your server, it will initialize itself and open up the possibility for you to deploy a web appication, which will then be made available to the outside world by the container through standard HTTP/HTTPS.
Perhaps before you dive into JSF you will want to review Java servlets which is the heart of a Java web environment. This free online book will explain it all:
You start your application server and the server starts various services and listeners, one of them being the http listener. It also accepts deployments (e.g a JSF-based web application). When a http request comes in to a web application on an URL path that has a JSF servlet registered (e.g. /faces/foo.xhtml), the JSF lifecycle takes over (http://www.ibm.com/developerworks/java/library/j-jsf2/index.html) the view is parsed, values are pulled from the model through EL expressions and the view is rendered. When you submit a value, again, stuff goes through the JSF lifecycle, is validates, values are applied to the model etc. There are plenty of tutorials to be found by googling but for a complete beginner I can understand it might be hard to get started. You might also want to consider a book on the topic.
With Java EE 6, the whole concept of the "Core EE patterns" is not that strict, I think. Sure, good patterns from the "Gang of Four" still applies but I don't see the use of DAOs and DTOs just because you have to. If need arises, extract stuff to interfaces, refactor. If you need alternative view layers, then you extract away the JSF imports to a separate bean etc.