SSM框架中多表查询结果显示到JSP页面的 问题

问题遇到的现象和发生背景

一个班级有多个学生,怎么将班级的字段属性,以及班级中包含的学生信息展示到JSP页面上呢
功能需求:实现通过查询班级ID同时查询出该班级下的所有学生,并且将查询结果通过JSP页面显示出来

班级实体类

public class Clazz {
    private int classId;
    private String className;
    private int classSpid;
    private List<Student> students;//一个班级包含多个学生

学生实体类

public class Student {
    private int stuId;
    private String stuName;
    private String stuGender;
    private int stuAge;
    private Date stuEntreTime;
    private String stuPhone;

班级Controller

@RequestMapping("/class")
public class ClassController {
    @Resource
    private ClassService classService;
    @RequestMapping("/show")
    public String listStudent(int classId, HttpServletRequest request){
        Clazz clazz = classService.queryClass(classId);
        System.out.println(students);
        if(clazz!=null){
            request.setAttribute("list",clazz);
            return "/pages/student/listStudent.jsp";
        }else{
            return "/pages/student/no.jsp";
        }
    }

班级的xml文件

<mapper namespace="com.jin.dao.ClassDAO">
<resultMap id="classMap" type="Clazz">
    <id column="class_id" property="classId"/>
    <result column="class_name" property="className"/>
    <result column="class_spid" property="classSpid"/>
    <collection property="students" ofType="Student">
        <id column="stu_id" property="stuId"/>
        <result column="stu_name" property="stuName"/>
        <result column="stu_gender" property="stuGender"/>
        <result column="stu_age" property="stuAge"/>
        <result column="stu_entretime" property="stuEntreTime"/>
        <result column="stu_phone" property="stuPhone"/>
<!--        <result column="stu_classid" property="stuClassid"/>-->
    </collection>
</resultMap>
<select id="queryClassByName" resultMap="classMap">
    select class_id,class_name,class_spid,stu_id,stu_name,stu_gender,stu_age,stu_entretime,stu_phone,stu_classid
        from class c inner join student s
            on c.class_id = s.stu_classid
        where class_id = #{classId}
</select>
</mapper>

显示班级列表的信息

<body>
<form action="class/show" method="post">
    <div class="condition">
        用户名:<input type="text" name="classId"/>
        <button>
            <i class="fa fa-search"></i>
            查询
        </button>
    </div>
</form>

<table class="tableList">
    <thead>
    <tr>
        <th>姓名</th>
        <th>班级</th>
        <th>课题名称</th>
        <th>指导教师</th>
        <th width="120px">操作</th>
    </tr>
    </thead>
        <tr>
            <td>${list.stuName}</td>
            <td>${list.className}</td>
            <td>123</td>
            <td>123</td>
            <td>
                <button class="edit">
                    <i class="fa fa-edit"></i>
                    修改</button>
                <button class="remove">
                    <i class="fa fa-remove"></i>
                    删除</button>
            </td>
        </tr>
</table>
<table class="page">
    <td>
        <button>首页</button>
        <button>上一页</button>
        <button>下一页</button>
        <button>尾页</button>
        <input type="text" class="pageNo" name="#"/>
        <button type="button"></button>
    </td>
</table>
</body>


通过web.xml

代码如下:

<c:forEach items="${list}" var="user" varStatus="vs">
        <tr>
            
             <td>
                <s:property value="#vs.index+1"/>
             </td>
             <td align = "center">${user.PId}</td>
             <td align = "center">${user.PLoginname}</td>
             <td align = "center">${user.PUserName}</td>
             <td align = "center">${user.PEmail}</td>
             <td align = "center"><html:department pdeptid="${user.PDeptid}"></html:department></td> <!-- 自定义标签 -->
         </tr>
</c:forEach>

参考链接:https://www.cnblogs.com/wdpnodecodes/p/7413070.html