繁体   English   中英

我想将数组的特定内容映射到我的 java 控制器中的字符串并显示在网页上

[英]I want to map specific contents of an array to strings in my java controller and display on a webpage

Map<String,Object> tenants = getPayload(request,uri);
        System.out.println("TENANTS -> " + tenants);

Map<String,Object> tenants_ = (Map) tenants.get("result");
        System.out.println(tenants_);

上面web控制器中的java代码在控制台打印出下面的数据;

TENANTS -> {result={result=[{rent={id=3, dateCreated=2022-06-08 16:38:08, 
reference=null, unitId=6, active=true, rentStart=2022-03-08 16:38:08, rentEnds=2023-03-08 16:38:08, 
numberOfPlans=2, totalAmountDue=, propertyId=4, landlordId=5, createdBy=5, tenantId=4}, tenant={id=4, dateCreated=2022-04-18 11:22:07, 
reference=null, fullname=Fela Kiti, usertype=null, email=fela@gmail.com, phone=null, picture=null, gender=null, password=null, enabled=true, deleted=false, emailVerified=false}}, {rent={id=1, dateCreated=2022-06-06 16:38:08, 
reference=null, unitId=3, active=true, rentStart=2022-06-24 16:38:08, rentEnds=2023-06-24 16:38:08, 
numberOfPlans=1, totalAmountDue=, propertyId=4, landlordId=5, createdBy=5, tenantId=2}, tenant={id=2, dateCreated=2022-03-05 21:08:25, 
reference=null, fullname=Olu Jacobs, usertype=null, email=olu@gmail.com, phone=null, picture=null, gender=null, password=null, enabled=true, deleted=false, emailVerified=false}}], totalRows=2, totalPages=1}, reponseMessage=result successfully retrieved, responseState=true}



{result=[{rent={id=3, dateCreated=2022-06-08 16:38:08, 
reference=null, unitId=6, active=true, rentStart=2022-03-08 16:38:08, rentEnds=2023-03-08 16:38:08, 
numberOfPlans=2, totalAmountDue=, propertyId=4, landlordId=5, createdBy=5, tenantId=4}, tenant={id=4, dateCreated=2022-04-18 11:22:07, 
reference=null, fullname=Fela Kiti, usertype=null, email=fela@gmail.com, phone=null, picture=null, gender=null, password=null, enabled=true, deleted=false, emailVerified=false}}, {rent={id=1, dateCreated=2022-06-06 16:38:08, 
reference=null, unitId=3, active=true, rentStart=2022-06-24 16:38:08, 
rentEnds=2023-06-24 16:38:08, 
numberOfPlans=1, totalAmountDue=, propertyId=4, landlordId=5, createdBy=5, tenantId=2}, tenant={id=2, dateCreated=2022-03-05 21:08:25, 
reference=null, fullname=Olu Jacobs, usertype=null, email=olu@gmail.com, phone=null, picture=null, gender=null, password=null, enabled=true, deleted=false, emailVerified=false}}], totalRows=2, totalPages=1}

以上已在控制台打印出来,如何在我的网页上显示数组的特定内容?

我基本上只是想将数组中名为“result”的一些特定项目映射到字符串并将它们显示在我的网页上。 (我使用 thymeleaf 扩展来为前端使用 HTML 和 CSS 格式文件)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM