You can use the streamresult to get only the row from the action.
Configure the action to use the result streamwith contentTypeset to text/plain(or don’t use it at all contentType, because it is text/plainset by default).
<action name="callAction" method="call">
<result type="stream">
<param name="contentType">text/plain</param>
</result>
</action>
InputStream getter/setter String .
private InputStream inputStream;
public String callAction() {
inputStream = new ByteArrayInputStream(
"some string".getBytes(StandardCharsets.UTF_8));
return SUCCESS;
}
ajax:
$.ajax ({
url: '<s:url action="callAction"/>',
type: 'POST',
dataType: 'text',
success: function (data) {
console.log(data);
}
});
. <s:url> url-s dataType string, text (jQuery MIME- ).