【问题标题】:HTML output is rendered improperly, Any ideas why?HTML 输出呈现不正确,任何想法为什么?
【发布时间】:2015-02-23 02:36:22
【问题描述】:

我使用的是 spring 2.5.6、hibernate 和 jsp。

我已经开始提高数据表的质量了。

我已将一些 jsp 文件从显示标记更改为 jquery 数据表。但是,一页发疯了。虽然其他页面的一切都一样,但是这个页面出现了一个该死的问题...... 见这里:

代码如下:

<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@include file="/common/taglibs.jsp"%>
<%@include file ="/WEB-INF/pages/dataTableUtil.jsp"%>

<head>
<title><fmt:message key="workDemandsAssignedByGroupChiefList.title"/></title>
<content tag="heading"><fmt:message key="workDemandsAssignedByGroupChiefList.heading"/></content>
<meta name="menu" content="WorkDemandsAssignedByGroupChiefList"/>
<style>
    /*    .margins
        {
            margin-left: 8px;
            margin-top: 8px;
            margin-right:  8px;
            margin-bottom: 8px;
        }*/
    .textFontSyle
    {
        color: #ac2925;

    }
</style>

</head>

<c:out value="${buttons}" escapeXml="false"/>
<strong><fmt:message key="workDemandsAssignedByGroupChiefList.heading"/></strong>



<table id="example" style="font-size: 110%" class="table table-striped table-bordered" cellspacing="0" width="100%">
    <thead>
        <tr>
            <th>Talep No</th>
            <!--<th>Talep Durumu</th>-->
            <!--            <th>Talep Eden Kullanıcı</th>-->
            <!--<th>Talep Türü</th>-->
            <!--<th>Özet Açıklama</th>-->
            <!--            <td></td>-->
        </tr>
    </thead>

    <tfoot>
        <tr>
            <th>Talep No</th>
            <!--<th>Talep Durumu</th>-->
            <!--            <th>Talep Eden Kullanıcı</th>-->
            <!--<th>Talep Türü</th>-->
            <!--<th>Özet Açıklama</th>-->
            <!--            <td></td>-->
        </tr>
    </tfoot>

    <tbody>
        <c:forEach var="item" items="${workDemandList}">

            <tr>
                <td> 
                    <c:out value="${item.id}" escapeXml="true" />
                </td>


            </tr>
        </c:forEach>
    </tbody>
</table>

【问题讨论】:

  • "workDemandList"是对应控制器返回的List。
  • 定义improve the quality?您现在正在包含 xml,显然我怀疑您的页面会受到影响...
  • 通过说“提高质量”我的意思是,用“显示标签库”填充表格它的行为很慢。用户无法搜索记录。所以我决定删除“显示标签”并通过 jquery 数据表填充表格。我包含了 Xml 的哪一部分?
  • 虽然你可以使用显示标签实现搜索(顺便说一句很容易),但你可能想看看datatables,它更新了很多。

标签: java html spring jsp datatable


【解决方案1】:

这是关于浏览器编码的。过滤器尝试压缩您的数据。您可以将其作为 gzip 编码进行搜索。您应该管理您的浏览器编码过滤器。

【讨论】:

    猜你喜欢
    • 2021-01-29
    • 1970-01-01
    • 2013-01-19
    • 2023-02-08
    • 1970-01-01
    • 2020-08-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多