Reputation: 3515
I have read the book core jsf. I would like to know if I can use bootstrap with jsf.
My question exactly is if jsf server tags have the attributes that are specific to bootstrap. For ex. if h:datatable has css class attribute?
What about other tags like paneled etc?
Upvotes: 0
Views: 1444
Reputation: 2321
Yes you can use Bootstrap together with JSF. We do so in most of our JSF projects. You can use the standard JSF styleClass
attribute to style JSF components with Bootstrap CSS rules (this is equivalent to class
in normal HTML.
With that said, there are sometimes some incompatibilities between the way Bootstrap presumes that the HTML is structured and what some of the components actually output. However - be aware that you can use any ordinary HTML tag on a JSF page - so if you hit upon issues - you can often just revert back to the ordinary way of doing things (not using JSF tags or components). Sometimes just sticking a styleClass
with the appropriate styling solves things also. You just have to experiment.
If you intend to use Bootstrap, you can use a Bootstrap-based component framework to get around some of the problems you might encounter when using Bootstrap together with the standard JSF components.
There are two to choose from that are under active development;
Both offer JSF Bootstrap components such as buttons, carousels, tables and panels based on the Bootstrap css rules and components.
Upvotes: 1