简体   繁体   中英

Primefaces encoding of & instead of &

Hi I am using PrimeFaces Autocomplete to display a list of business names. The business names are held in an Oracle Database. The problem is that for a business name, like B & Q, autocomplete displays the & as & for example B & Q. I tried using a URLDecoder method with business.getBusinessName() as the string and was having no success. Any suggestion on how to resolve this HTML encoding problem? Thanks Bryce

Managed to use the word "and" instead of the ampersand symbol using the following code. Not ideal but it is a workaround.

businessNameCapitalized.setDisplayName(WordUtils.capitalizeFully(businessNameCap‌​italized.getBusinessName()).replaceAll("\\B&\\B", "and"));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM