GoogTech / sms-ssm

:school::mortar_board: 一个基于 SSM 的简单学生管理系统,项目概述全面,代码注释详细,逻辑结构清晰,对于初学 SSM 的同学非常具有参考与学习价值哟 !
MIT License
648 stars 146 forks source link

学生与班级名搜索按钮的监听事件中是如何将其值返回给Controller的? #17

Open Yong-Hee opened 4 years ago

Yong-Hee commented 4 years ago

比如在studentList.jsp的263行中,通过搜索按钮的监听事件获取到了studentname和clazzname的属性值。我想知道它是如何将值提交给controller的?在哪里调用了getStudentList()? pers.huangyuhui.sms.controller.StudentController.getStudentList(Integer page, Integer rows, String studentname, String clazzname)方法中的 page和 rows又是从前端的哪里获取到值的呢?

GoogTech commented 4 years ago

the first problem : how to send the request to controller

  1. first step : input the value of studentname and clazzname https://github.com/YUbuntu0109/sms-ssm/blob/fc31def843db8c3bc5dd9311c7883ec69a72bd45/sms/src/main/webapp/WEB-INF/view/student/studentList.jsp#L331-L352

  2. second step : get the value of studentname and clazzname ( please pay attention to the attribute of #dataList ) https://github.com/YUbuntu0109/sms-ssm/blob/fc31def843db8c3bc5dd9311c7883ec69a72bd45/sms/src/main/webapp/WEB-INF/view/student/studentList.jsp#L263-L269

  3. third step : send the request to the controller https://github.com/YUbuntu0109/sms-ssm/blob/fc31def843db8c3bc5dd9311c7883ec69a72bd45/sms/src/main/webapp/WEB-INF/view/student/studentList.jsp#L31-L41

the second problem : how to get the vaule of page and rows

the specified code be shown as below : https://github.com/YUbuntu0109/sms-ssm/blob/fc31def843db8c3bc5dd9311c7883ec69a72bd45/sms/src/main/webapp/WEB-INF/view/student/studentList.jsp#L45

https://github.com/YUbuntu0109/sms-ssm/blob/fc31def843db8c3bc5dd9311c7883ec69a72bd45/sms/src/main/webapp/WEB-INF/view/student/studentList.jsp#L65-L72