sms-ssm icon indicating copy to clipboard operation
sms-ssm copied to clipboard

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

Open Yong-Hee opened this issue 5 years ago • 1 comments

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

Yong-Hee avatar Aug 19 '20 14:08 Yong-Hee

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

GoogTech avatar Aug 20 '20 02:08 GoogTech