How JSF el expression works and when a JSF variable resolver will be involved while evaluating any JSF exprestion?

一笑奈何 提交于 2019-12-01 12:09:03

问题


I am in a bit confusion.

That's how a JSF EL will work and how variable resolver involved while evaluating expressions like.

<h:outputlabel value="#{text.value}"/>

or

<h:outputlabel value="#{text['value']}"/>

Text refers to bundle var arg and value is the key in properties file.

Help me in understanding the evaluation of above expression when reading a property value from message properties.

Thanks in advance.

Regards, Ganesh karanam


回答1:


JSF uses Unified EL for evaluating expressions. The specification uses ELResolvers to determine the value of variables referenced in the expression.

The 'text' variable is likely getting stored in a standard scope (page, request, session, or application). The ScopedAttributeELResolver handles looking up objects from these scopes. The object returned by the ELResolver for 'text' variable is then used as the base for resolving the 'value' property.

There is a ResourceBundleELResolver that knows how to access objects contained within a ResourceBundle. The ResourceBundleELResolver will handle the looking up the 'value' property of the 'test' variable.



来源:https://stackoverflow.com/questions/33576739/how-jsf-el-expression-works-and-when-a-jsf-variable-resolver-will-be-involved-wh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!