• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF equivalent for include directive  RSS feed

 
Gerin Jacob
Greenhorn
Posts: 8
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am aware of two options to include a web resource in a JSP page: the include directive and the jsp:include

In JSF ui:include (i presume), is the equivalent for jsp:include.

Is there an equivalent in JSF for include directive? I am using JSF 2.0 with xhtml

Many Thanks,
Gerin
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The reason that straight JSP has 2 different types of "include" is that one of them compiles the included source inline with the compilation of the parent source but the other compiles them separately and connects them via logic.

JSF doesn't work with View definitions that way. In JSF, most of the work is done against a complex data structure (the component tree). Only when the rendering phase kicks in do the renderers run the tree to generate HTML (assuming that you are in fact, configured to render HTML instead of some other type of content).

All of which means that the Facelets ui:include directive is going to simply cause the included source to be compiled into the current View component tree in all cases, so there's only that one type of "include" in JSF.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!