jsfnetbeansxml-encoding

"Unexpected token ERROR found" error shown at netbeans working on a jsf project for percent (%) character


I am facing a strange issue with netbeans and jsf, it is not fatal but quite annoying.

For some reason I am getting the error "Unexpected character % found Unexpected token ERROR found" from netbeans for the following code block.

It is complaining about the percent sign, do you have any idea how to resolve this? I tried to escape it with xml encoding of percent with "%" but then it started complaining about & character..

<div class="bar" style="width: #{cc.value.relevance}%;"></div>

Solution

  • Imho, You should add a cast like:

    object.toString().append("%");
    

    before it gets call by the front-end.