Ajax响应包含未翻译的struts2标签

时间:2018-07-10 13:20:33

标签: ajax struts2 outputstream ajax-request actioncontext

我使用的ajax请求在服务器端构造了一个模式框。模态框的内容将包含一个“计算的”链接,并用以下格式包围:

StringBuffer htmlBuffer = new StringBuffer();
htmlBuffer.append(
...
"<td>"+
"<s:form action='goToLocationAction' id='formId'>" +
"<s:textfield class='form-control hidden' name='mybean.beanid' value='" + getStringContent(entity.getBeanId()) + "'/>" +
"<s:a href='#' onClick='document.getElementById('formId').submit();'>" + getStringContent(entity.getBeanId()) + "</s:a>" +
"</s:form>" +
"</td>"...
);

mapper.writeValue(ServletActionContext.getResponse().getOutputStream(), htmlBuffer.toString());

在客户端结果页面上,struts标记未转换为HTML。

任何想法如何正确执行此操作?

谢谢。

0 个答案:

没有答案