Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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".

share|improve this question

2 Answers 2

up vote 3 down vote accepted

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).

share|improve this answer
2  
JSF 2.0 is in Java EE 6 however, so it is a standard framework which may pick up momentum when Java EE 6 is mainstream. –  user1249 Jun 25 '11 at 11:13
    
Absolutely agree. –  Steve Taylor Jul 1 '11 at 19:23

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.