jsp获取java数据,JSP-将数组数据从Java获取到JSP中

本文介绍如何在Spring MVC应用中从数据库获取数据并将其以表格形式展示在JSP页面上。首先,将数据存储到List中,然后在Servlet中处理并转化为2D字符串数组或List。接着,将数据作为请求属性设置,并转发到JSP。在JSP中,利用JSTL来呈现数据。
摘要由CSDN通过智能技术生成

I have to display data fetched from DB to JSP. I am using spring MVC. I have stored data in List in java. Now i need to access this list in JSP and display it in tabular form.

Data needs to represented in tabular form from List and VO, column names and row names coming from List and corresponding values for row/column from object.

e.g

Column1 Column2 Column3 Column4

Row1 A B C D

Row2 E F G H

How can i pass this List and Object in jsp from java.

Thanks

解决方案

Process it on servlet and store it in 2D array of String or List>

Set it as attribute to request, forward request to jsp.

on jsp use JSTL to represent data. using

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值