I am trying to create a condition for a link where if the length is not = 0 then show the description but I am getting a syntax error the code is:
<c:if test="#{fn:length(#{pqfn:format('ACTUAL_LINK')}) != 0}">
<h:outputLink id="link1" value="#{pqfn:format('LINK_DESCRIPTION')}"/>
</c:if>
The error I am receiving is:
Caused by: org.apache.el.parser.ParseException: Encountered " <ILLEGAL_CHARACTER> "{ "" at line 1, column 14.
Was expecting one of:
"." ...
")" ...
"[" ...
"," ...
">" ...
"gt" ...
"<" ...
"lt" ...
">=" ...
"ge" ...
"<=" ...
"le" ...
"==" ...
"eq" ...
"!=" ...
"ne" ...
"&&" ...
"and" ...
"||" ...
"or" ...
"*" ...
"+" ...
"-" ...
"/" ...
"div" ...
"%" ...
"mod" ...
You can not nest EL expressions as in
#{... #{... ...} ...}
. This is not making any sense. You should see an EL expression#{... ...}
as one big scope where various EL scoped variables and EL functions can interact with each other.The proper syntax is:
The particular exception you got is thrown because the EL parser unexpectedly encountered an
{
while one of the listed character sequences was expected at that point.You seem to be nesting one EL expression inside another ... that won't work: