2

I have a PersonController that has the property person. The person itself has the properties firstName, lastName, etc.

When I access them in the view i always have to write:

<h:outputText value="#{personController.person.firstName}"/>
[...]

To simplify i created an "alias" via

<c:set var="p" value="#{personController.person}"/>

and now I can write

<h:outputText value="#{p.firstName}"/>

Here is written that you should avoid c:set if possible.

Question 1: Why should I avoid it?

Question 2: What is the alternative for my "problem"?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Sebi
  • 2,534
  • 2
  • 26
  • 28

1 Answers1

2

There the <ui:param> can be used for.

<ui:param name="p" value="#{personController.person}" />

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555