• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSF equivalent for include directive

 
Greenhorn
Posts: 8
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic