Feeling doubts about JSF?

After having done a project in JSF and reading what others in the JSF community have to say about it, I'm starting to wonder what the future of JSF will be like.

Some of my biggest challenges with JSF are:

  • If you view the source of my pages, it looks like FrontPage barfed into a Java OutputStream. So much for clean XHTML with all JavaScript in separate files, CSS completely removed, nice clean readable and small XHTML. It's hard for me to find the location of a layout problem so that I can tweak it.
  • Components force their themes on you and you can't change their look without copying the theme file, and editing an 800 line CSS file. For example, the standard button on a webpage is fancy and stylized. I am making a website that has to look exactly like the rest of the company's websites and therefore have a custom look to the buttons.
  • I wanted to use something similar to Struts' iterate, or JSP's forEach but it seems that I'm forced to use the table component which looks absolutely nothing like what I want. I still haven't figured out how to iterate through a collection of Strings (loaded from a JSF Mbean) and display them on the JSP.
  • I haven't tried JSF without NetBeans' Visual Web Pack and I'm wondering how lost I'd be without it.
  • The URLs aren't bookmark friendly
  • There are almost no jobs out there for JSF, despite the fact that it's a JSR standard supported by all the big vendors.
  • I'm having trouble trying to work with components in a page fragment from the main page since they have different backing beans.
  • I don't like working in strict XML JSP files, I'd prefer to work in XHTML.

Basically there are a lot of hoops I'm jumping through. I know that I'm new to working with JSF and figure once I realize what I'm doing wrong things will make sense. I really want JSF to be successful. It's component model and lifecycle events are great. There are some open source projects that address most/all of JSF's issues and apparently make it very usable, such as Apache Shale and JBoss Seam.

Shale is written by the creator of the famous Struts framework. He was one of the JSF spec co-developers, and now works for Sun on the Visual Web Pack (JSF in NetBeans). I read in a mailing list or on one of his websites that he thinks JSF was rushed to compete with ASP.NET, so he created Shale to show what he thinks JSF should have been like.

The only problem I have with Shale is that it's not a JSR standard. I'm one of those guys who prefers to use JSR standards such as EJB 3.0 instead of Spring, JPA instead of Hibernate. Sun learned a lot from Hibernate and Spring and evolved Java EE based on what they learned. I hope Sun learns again from Shale, JBoss Seam, Tapestry and others, then quickly evolves JSF.

The other thing I wonder about is Tapestry? It is supposedly very similar to JSF in that it has a component model, and I hear a lot of the problems in JSF are non-issues in Tapestry. Again since it's not a JSR, and there are very few jobs out there that ask for it, I'm a bit reluctant to spend the time on it. I'd rather look into something based on JSF such as Shale or Seam.

So here we are, early 2007.. and I'm not sure what direction I want to go as far as web frameworks. For now I'll continue with JSF and do some experimentation at home with the other options.

Update!! - It turns out Sun has been paying attention to the community and since the summer of 2005 has been working on something called facelets that completely replaces JSPs, and makes JSF like Tapestry! =D They even have a NetBeans plugin for it, and facelets is part of the JSF 1.2 reference implementation that comes in Sun App Server/Glassfish. For use with other app servers you need to use the Apache MyFaces implementation until facelets become standardized. I read an IBM blog that can't say enough good things about how facelets make JSF usable. What's even better is that one of the lead NetBeans Visual Web Pack developers said that there are plans for future inclusion of facelets in the nbusers mailing list. I think I have found exactly what I'm looking for, and will stay loyal to JSR-127.. I mean Java Server Faces :)

Comments:

Post a Comment:
Comments are closed for this entry.