File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Good or evil , Mixing JSF components with HTML elements ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Good or evil , Mixing JSF components with HTML elements ?" Watch "Good or evil , Mixing JSF components with HTML elements ?" New topic

Good or evil , Mixing JSF components with HTML elements ?

Hussein Baghdadi
clojure forum advocate

Joined: Nov 08, 2003
Posts: 3479

As we all know, we can built our entire pages using JSF components only, there is no need to use HTML tags.
But what about the performance ? (since JSF maintaines a tree of components, create a new whole page if needed) ?
In JSF's best practice world ? is it ok to use ordinary HTML elements if we don't need to access the components at the server-side ?
(like using table element instead of dataGrid component or using <c ut> instead of outputText component).
Any ideas ?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

Mixing JSF components and pure HTML can sometimes produce undesireable results in that the components will get rendered outside of the HTML you thought they should be inside of. It's more of a layout issue than anything else. JSF 1.2 is supposed to resolve this. That's about the only issue I know of other than just being consistent across all your pages.

GenRocket - Experts at Building Test Data
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17423

If you must mix HTML and JSF, use the verbatim tag to reduce the infighting.

In general, JSF is supposed to be a markup language in its own right, somewhat more abstracted than HTML is - meaning easier to link to alternative, non-HTML rendering engines.

In reality, mostly we're expecting to render only to HTML web browsers, so the purist JSF approach can be a right royal pain, but there it is.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Good or evil , Mixing JSF components with HTML elements ?
jQuery in Action, 3rd edition