Pages

Saturday, November 27, 2010

Dynamic JSF 2.0 Page

I have had a number of folks ask about templates and JSF. There seems to be a misconception that you need a template for all of your content, and that the content can not be dynamically generated for a page. This is not true! I am not sure where this comes from, but it is not uncommon question.

Dynamic JSF Page

The example NetBeans project in the link below, demonstrates how to to use the binding attribute to inject the required information into a page before rendering it. I have added the binding attribute to the <body> tag. This allows me to modify the content of the page body before it is rendered.

I have also included how to use the ValueExpression to set the value of the rendered text. This example should be sufficient to demonstrate the capabilities.

The project code is a NetBeans project: DynamicJSF.zip
Enhanced by Zemanta

2 comments :