We have a Struts2 application using Struts2-jQuery framework for Ajax operations. While using the Autocompleter (sj:autocompleter) tag in Struts2-jQuery as follows, it makes an ajax request to the Struts2 Action jsonlanguages.
<s:url var="remoteurl" action="jsonlanguages"/>
<sj:autocompleter
id="languages"
href="%{remoteurl}"
delay="50"
loadMinimumCount="2"
/>
We have defined a result type ERROR for this action as follows, to trigger an Internal Server error instead of it getting completed as a successful ajax request.
<result name="ERROR" type="httpheader">
<param name="status">500</param>
<param name="headers.a">a custom header value</param>
<param name="headers.b">another custom header value</param>
</result>
Issue: Now this approach triggers the "onErrorTopics"
in all other Struts2-jQuery tags like sj:select
..etc, but it does not seem to be triggering the same in an sj:autocompleter
. Has anybody faced this issue ? If so, what is the best way to handle exceptions that happen during an ajax request from an autocompleter ?