简体   繁体   中英

Struts2 jQuery Autocompleter Not Escaping ASCII

I am currently trying to find a way to escape ASCII or special characters in my autocompleter, but with no luck. I am using the Struts2 jQuery autcompleter , and when there is an & in the list, it translates as & . This makes life difficult for the users, for a number of reasons, so I figured there would be an attribute similar to escapeHtml. So far, my searching has come up with nothing. I managed to stumble across a similar question , but it wasn't too useful.

My action class is setting the values correctly, leaving me to think that this is some feature of the autocompleter. Seeing as how nobody has complained, I am guessing that maybe I am doing something wrong. I will try to include relevant code below as to how I'm setting things.

Taglib declaration:

<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>

Autocompleter declaration:

<sj:autocompleter id="parentLookup" name="parentLookup" list="%{parentListArray}" forceValidOption="true" loadMinimumCount="3" style="width:245px" onblur="checkIssuerParentRelationship()"  />

Oh, and the parentListArray is simply a String array.

Any help would be much appreciated.

Though this is an old question, maybe the answer may appear useful for someone. I have had the same problem trying to display quotes and the autocompleter have always been showing &quot; in each place. The solution was to add the following attribute to sj:autocompleter:

selectBox="true"

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