I'm attending a company sponsored training event for JSF and JPA that crams 10 days of training into 5 days. I plan on getting all that I can out of the class, but there is no "final exam".
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
closed as off-topic by gnat, Dan Pichelman, MichaelT, Bart van Ingen Schenau, Kilian Foth Sep 23 '14 at 11:03
This question appears to be off-topic. The users who voted to close gave this specific reason:
JPA - Yes absolutely, it's the standard underpining most Java ORM libraries out there (e.g. Hibernate).
JSF? - Not so much, it's not seen as a dominant std (that said, no web framework is the dominant std) and is expected to keep slipping in terms of mind-share and deployment (unless some radical changes are made).
JSF 2.0 is quite nice and it's easy to get started on NetBeans 7 with GlassFish 3.1. I recommend buying Core JavaServer Faces 3rd Edition (book), which is a good starting point, otherwise you'll be lost once you start building something substantial. (Alternatively, you could try JavaServer Faces 2.0, The Complete Reference, but I haven't read much of this myself.) PrimeFaces is the best component library going around at the moment and has a sizeable community and active forum. It's based heavily on jQuery which means you can skin your app with ThemeRoller.
One advantage of JSF over JSP is that it manages the entire request-response lifecycle in its controller servlet so you don't have to. The key to your success is becoming familiar with this lifecycle, knowing what the different stages are and when you can expect various event types to be fired.
JPA will save you a lot of time if you don't try to fight against it. Don't try to build the perfect data model in your database then expect to be able to shoe-horn it into a Jave EE with JPA app. Either allow JPA to create your data model from the entity classes you provide, or become familiar with JPA's data modelling limitations, accept the reality that you'll have to enforce more business rules (compared to what you might be used to) in code instead of at the data model level. Try to avoid composite primary keys, except for join tables of course. JPA can't auto-generate values in composite primary keys.
NetBeans can auto-generate the full code stack for performing CRUD operations via the web. This auto-generated code consists of JPA, EJB and JSF. It may be a good starting point for what you're building. At the very least, it will be a good learning tool.