Search code examples
jsffacelets

How many ways there are to declare variables in facelets?


I noticed that c:set does not work well used inside "include of include of include", as important notice facelets documentation does't recommend it too.

Now I am using ui:param inside ui:include, but it is a bit dispersive when no attached notes about params comes with the include, is there something other way to declare "global vars"?


Solution

  • This is really a matter of trying to fit old JSP programming into the JSF framework. You should be using backing beans to hold your data.

    If you try to hard-code data directly into your xhtml file, you are defeating the purpose of JSF's MVC framework. If you have a specific example of what you are trying to do, I could give you a specific recommendation.