需要显示响应,这是视图页面上的html代码

时间:2019-05-21 14:51:18

标签: java html spring spring-boot

我有一个来自后端的响应,该响应将显示在我的html页面上。我正在使用thyeleaf作为前端。后端响应本身就是一个html代码。在当前情况下,我的视图按原样显示该响应。我正在寻找的是将html响应以html格式显示,即没有那些html,body标签等,这样看起来更好。

这是我的html响应,我需要在视图上以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响应。

1 个答案:

答案 0 :(得分:1)

您可以尝试这样使用吗?

<tr>
    <th style="vertical-align: top">Message</th>
        <td th:utext="${responseMessage}"></td>
</tr>
相关问题