JSF due diligence

Hello,

I am investigating web frameworks suitable for the new project that I am going to undertake. I read a lot of pros and cons about JSF and I am wondering how much of it really matters in real world usage.

Our product has Swing based UI. The new project I am looking into will be a web based UI (like JSP) that would share a lot of the business logic with this Swing UI. We are using Java 5 with tomcat. I started looking to web frameworks mainly to have a MVC setup as we are sharing the business logic. Boy I am suprised at the alphabet soup of web frameworks!

I hope that JSF users in this forum could shed some light on some of the points given below.

- I hear that HTML and JSF cannot be mixed -- to what extent is HTML allowed in JSF pages - can we have html for layouts, javascript for some functionality and then JSF for forms, etc?

- We were also considering the possibility of hiring graphic designers that would do the bare bone L&F. Would that be not possible if we go with JSF?

- Another popular complaint is that there are not sufficient components. Do you find that you are creating custom components/searching for components a lot?

- To what extent are these components and the ones that support AJAX browser compliant?

- Are Facelets, JBoss Seam, MyFaces different implementations of JSF? Where does Dynamic Faces, jMaki etc fit in?

Thanks for your input!

Priya

[1455 byte] By [exception512a] at [2007-11-27 7:27:03]
# 1

- I hear that HTML and JSF cannot be mixed -- to what extent is HTML allowed in JSF pages - can we have html for layouts, javascript for

some functionality and then JSF for forms, etc?

HTML and JSF can absolutely be mixed but you need to use the ugly verbatim tag to do this. My advise is to use a third party framework and avoid mixing HTML and JSF tags if you can.

- We were also considering the possibility of hiring graphic designers that would do the bare bone L&F. Would that be not possible if we go with JSF?

While it is always the promise of JSF the last time I used a Usability group and JSF they went off into custom component land.It is possible but make sure you tell them they should stick with JSF components and skins.

- Another popular complaint is that there are not sufficient components. Do you find that you are creating custom components/searching for components a lot?

Right out of the box if you are an oracle shop definitely use ADF Rich Faces. If you are not and ok with open source then I recommend Apache Trinidad which is a free subset of ADF components. You might also look at ICEFaces (JBoss) and there are a few others out there. My recommendation is to get an idea of the type of UI components you want and then find a component suite that fits what you need the best. DO NOT try a JSF project with just the standard JSF component suite you get out of the box ... you will meet with frustration and failure.

- To what extent are these components and the ones that support AJAX browser compliant?

ADF, Trinidad, and ICEFaces are all AJAX component suites. There are others. The latest ADF rich client faces only supports the latest Firefox and Explorer browser, Trinidad is supports older Firefox and Explorer 5.5 and 6.0, not sure about ICEFaces.

- Are Facelets, JBoss Seam, MyFaces different implementations of JSF? Where does Dynamic Faces, jMaki etc fit in?

They are all the same JSF. You cannot really mix and match AJAX implementations. Thus if you go with an AJAX component suite you are really stuck with just that component suite plus any non-AJAX JSF components (like standard JSF components etc). The real problem with JSF + AJAX is the AJAX part since there is no standard for AJAX implementations (e.g Dynamic Faces, DOJO, jMaki, etc). Facelets is just an XML mechanism on top of JSF and really plays on its own. JBoss Seam is more of a comprehensive solution that includes JSF and provides support to JSF in terms of server side stuff. You will find that the Seam "Conversation" is a great addition to the standard JSF scopes.

My two cents

smurray_eriea at 2007-7-12 19:07:31 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Thanks a lot for your response! It is certainly worth more than two cents for me :)

Could you please elaborate on "use a third party framework" to avoid mixing HTML and JSF. Can you please give me some examples of such frameworks?

I am showing my ignorance here - does JSF do processing on the client or the server? Also, will there be any difference in performance when using these components versus the straight HTML tags?

Thanks again!

Priya

exception512a at 2007-7-12 19:07:31 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
FWIW, I use facelets exclusively and I have never had any issues mixing JSF and HTML tags and have never needed to use the verbatim tag.
RaymondDeCampoa at 2007-7-12 19:07:31 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

A lot of people like facelets as they get you out of JSP programming and as last user stated you can mix HTML and JSF much easier (really dhtml). I have no position on facelets and think it is fine to use if you want.

To answer HTML and JSF question, I feel that if you are using HTML constructs (e.g <table> or <input>, etc) then of what value has JSF been to you. The reason this happens is because the JSF implementation does not provide a rich enough set of components that allows most users to construct the web applications they need. In these cases they either drop back into pure JSP or HTML programming and construct these component elements on their own. Its like programming in C++ and then dropping into assembler. The code becomes a mess especially if you are using JSP. This is why many users like facelets as an alternative, it simplifies using these two mechanisms. Facelets/Dhtml and is certainly easier to code and maintain than JSP.

By third party frameworks I am refering to JSF implementation that provides out of the box components like rich layouts, trees, menus, Ajax enabling of basic components. These frameworks provide a richer suite of components that should allow you to do 95% or better of your work using that component suite only, no HTML or shoe horning some AJAX framework in as well required. I will tell you that this will cut months off your project.

Look at framework like Trinidad from Apache, ICEFaces (now part of JBoss), Tobago from Apache, etc. My favorite is Trinidad but others can chime in, I am not here to push one framework or another. I will say pick one that gets you the types of components with the richness (e.g. Ajax enabled) you need so you can be sucessful.

Finally, JSF is a server side technology. Except for those JSF components that are enhanced using javascript (AJAX) all of the business logic and the majority of the view logic remain on the server.

I doubt you will see performance differences. After all, in the end all JSF components are emitting HTML it just that YOU don't want to be writing HTML, leave that to the JSF component rendering.

The only negative JSF performance issue is the fact that JSF is a memory hog with respect to your server and this has to do with the caching of view state. It does support client side state saving ala .NET but these are more advanced topic than just this thread.

Good luck,

Steve

smurray_eriea at 2007-7-12 19:07:31 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
Thanks a lot for the information Steve! I will look into Facelets as well. CheersPriya
exception512a at 2007-7-12 19:07:31 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...