jsp把list中对象循环输出为列显示

如题所述

jsp把list的行倒转为列后再输出到页面上才能按照列显示:
比如以下sql语句输出成绩列表是把行转为列:
select t.user_name,
sum(decode(t.course, '语文', score,null)) as CHINESE,
sum(decode(t.course, '数学', score,null)) as MATH,
sum(decode(t.course, '英语', score,null)) as ENGLISH
from test_tb_grade t
group by t.user_name
order by t.user_name
以上结果查询出来后封装到list中,然后用jstl标签迭代就是列显示了。
温馨提示:内容为网友见解,仅供参考
第1个回答  2016-01-05

404 - Servlet LoginServlet HTTP状态是不可用的

这个是什么情况

追问

别乱发

第2个回答  2016-01-09
if (temp <= 256 - wbegin)
num = 0;
else
{
num = ceil((temp - (256 - wbegin))*1.0 / 256);
}
第3个回答  2016-01-08
<%
for(test t: list)
{
%>
<tr>
<%
=t.xxx
%>
<tr>
<%
}
%>
第4个回答  2016-01-07
用c标签<c:foreach></c:foreach>
相似回答