简体   繁体   English

Struts2 jQuery自动完成器未转义ASCII

[英]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. 我目前正在尝试寻找一种在自动完成程序中转义ASCII或特殊字符的方法,但是没有运气。 I am using the Struts2 jQuery autcompleter , and when there is an & in the list, it translates as & 我使用的是Struts2 jQuery autcompleter ,当列表中有&时,它表示为& . This makes life difficult for the users, for a number of reasons, so I figured there would be an attribute similar to escapeHtml. 由于多种原因,这使用户的生活变得困难,因此我认为会有类似于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声明:

<%@ 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. 哦,parentListArray只是一个String数组。

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; 我在尝试显示报价时遇到了同样的问题,而自动填充程序始终显示&quot; in each place. 在每个地方。 The solution was to add the following attribute to sj:autocompleter: 解决方案是向sj:autocompleter添加以下属性:

selectBox="true"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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