#include staticly includes a file into your page.
<!include> (or <ui:include> in the facelets syntax) dynamically includes
a file into your page. Also <!include> supports passing in parameters
to the included page. For example:
test.jsf:
<!include src="foo.jsf" foo='bar' />
foo.jsf:
"The value of foo: #{foo}
Try that.
The pro's for #include... from JSFT's perspective it is only 1 file and
therfor id's are never a problem. It's also fast and efficient (the
other way isn't bad, but this one is faster).
The pro's for <!include>, it's dynamic so you can use #{} to determine
the template name and you can pass in values. The big advantage comes
from the closely related tag: <!composition> which allows you to use
<!define> to pass values to a template. This is very powerful.
Let me know if you need more details.
Thanks,
Ken
Anissa Lam wrote:
>
> Hi Ken,
> I am not sure under when i should use <!include> or when I should
> use #include. Whats the pros or cons for each of this.
> Can you clarify ?
>
> thanks
> Anissa