洛丁山奈 2017-06-06 03:32 采纳率: 33.3%
浏览 1996

从solr查出的json字符串,如何在html页面,通过thymeleaf模板解析成表格?求代码啊?

 [
    {
        \"dataAcquisitionSections\": [
            {
                \"dataAcquisitionInformationItems\": [
                    {
                        \"data\": \"8005\",
                        \"label\": \"port\"
                    },
                    {
                        \"data\": \"SHUTDOWN\",
                        \"label\": \"shutdown\"
                    }
                ],
                \"path\": \"\",
                \"dataAcquisitionSections\": [

                ],
                \"section\": \"ShutdownPort[
                    Server
                ]\",
                \"label\": \"Ports-Shutdown\"
            },
            {
                \"dataAcquisitionInformationItems\": [
                    {
                        \"data\": \"20000\",
                        \"label\": \"connectionTimeout\"
                    },
                    {
                        \"data\": \"8089\",
                        \"label\": \"port\"
                    },
                    {
                        \"data\": \"HTTP/1.1\",
                        \"label\": \"protocol\"
                    },
                    {
                        \"data\": \"8443\",
                        \"label\": \"redirectPort\"
                    }
                ],
                \"path\": \"\",
                \"dataAcquisitionSections\": [

                ],
                \"section\": \"ServiceConnectorPorts[
                    1
                ][
                    Server/Service/Connector
                ]\",
                \"label\": \"ServiceConnectors\"
            },
            {
                \"dataAcquisitionInformationItems\": [
                    {
                        \"data\": \"8009\",
                        \"label\": \"port\"
                    },
                    {
                        \"data\": \"AJP/1.3\",
                        \"label\": \"protocol\"
                    },
                    {
                        \"data\": \"8443\",
                        \"label\": \"redirectPort\"
                    }
                ],
                \"path\": \"\",
                \"dataAcquisitionSections\": [

                ],
                \"section\": \"ServiceConnectorPorts[
                    2
                ][
                    Server/Service/Connector
                ]\",
                \"label\": \"ServiceConnectors\"
            }
        ],
        \"cause\": \"\",
        \"label\": \"ServerXml\",
        \"title\": \"conf/server.xml\"
    },
    {
        \"dataAcquisitionSections\": [
            {
                \"dataAcquisitionInformationItems\": [
                    {
                        \"data\": \"solr\",
                        \"label\": \"InstalledApplicationName\"
                    },
                    {
                        \"data\": \"D: \\\\software\\\\Tomcat\\\\apache-tomcat-8.5.15-windows-x64\\\\apache-tomcat-8.5.15\\\\webapps\\\\solr\",
                        \"label\": \"InstalledPath\"
                    },
                    {
                        \"data\": \"No\",
                        \"label\": \"WarFile\"
                    }
                ],
                \"path\": \"D: \\\\software\\\\Tomcat\\\\apache-tomcat-8.5.15-windows-x64\\\\apache-tomcat-8.5.15\\\\webapps\\\\solr\",
                \"dataAcquisitionSections\": [

                ],
                \"section\": \"/solr\",
                \"label\": \"WebApps\"
            }
        ],
        \"cause\": \"\",
        \"label\": \"Webapps\",
        \"title\": \"InstalledWebApplications\"
    },
    {
        \"dataAcquisitionSections\": [

        ],
        \"cause\": \"\",
        \"label\": \"ContextXml\",
        \"title\": \"conf/context.xml\"
    },
    {
        \"dataAcquisitionSections\": [
            {
                \"dataAcquisitionInformationItems\": [

                ],
                \"path\": \"D: \\\\software\\\\Tomcat\\\\apache-tomcat-8.5.15-windows-x64\\\\apache-tomcat-8.5.15\\\\bin\\\\catalina.sh\",
                \"dataAcquisitionSections\": [

                ],
                \"section\": \"JavaOptions\",
                \"label\": \"JVM\"
            }
        ],
        \"cause\": \"\",
        \"label\": \"bin\",
        \"title\": \"Catalina.sh\"
    }
]


这是从sorl中查出来的数据

 public List<Object> hawkeyeTomcat() throws Exception {
        HttpSolrServer solrServer = new HttpSolrServer(host);
        SolrQuery solrquery = new SolrQuery();
        solrquery.setQuery("agentId:ServicePlatform_Middleware_Tomcat");
        QueryResponse response = solrServer.query(solrquery);
        SolrDocumentList results = response.getResults();
        List<Object> listdoc = new ArrayList<Object>();
        for (SolrDocument solrDocument : results) {
            Map<String, Object> hashMap = new HashMap<String, Object>();
            hashMap.put("optional", solrDocument.get("optional"));
            listdoc.add(hashMap);
        }
        return listdoc;
    }
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥60 版本过低apk如何修改可以兼容新的安卓系统
    • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率
    • ¥15 TI的insta-spin例程
    • ¥15 完成下列问题完成下列问题
    • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
    • ¥15 YoloV5 第三方库的版本对照问题
    • ¥15 请完成下列相关问题!
    • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?