作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我收到了来自后端的响应,该响应将显示在我的 html 页面上。我使用 thyeleaf 作为前端。后端响应本身就是一个 html 代码。在当前场景中,我的 View 按原样显示该响应。我想要的是让 html 响应以 html 格式显示,即没有那些 html、body 标签等,这样看起来更好。
这是我的 html 响应,我需要在 View 上以 html 格式显示它。
<HTML> <HEAD></HEAD><BODY><PRE> Checking oracle status for instance jsx (performs a tnsping to jsx) ========================================================== jsx TNS failure - unable to test database status from server apsrs0170 Could not perform a database connection test from central server. Looks like TNS is not setup for this database. Please open up Additional Services Request for DBA group to fix the issue. ESC_SCRIPT_FAILURE
我需要使用此响应的 html 代码:
<tr>
<th style="vertical-align: top">Message</th>
<td th:text="${responseMessage}"></td>
</tr>
这里的responseMessage是html响应。
最佳答案
你能尝试这样使用吗?
<tr>
<th style="vertical-align: top">Message</th>
<td th:utext="${responseMessage}"></td>
</tr>
关于java - 需要显示响应,它是 View 页面上的 html 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56240976/
我是一名优秀的程序员,十分优秀!