searchStudentName模块设计:

函数使用:HttpServletRequest的getSession()方法和setAttribute()方法。

实现逻辑:从前端传入查询的学生名字,将其存入session中,以便后续的selectStudent模块中使用。

selectStudent模块设计:

函数使用:HttpServletRequest的getSession()方法和getAttribute()方法,以及PageHelper插件中的startPage()方法和PageInfo类的构造函数。

实现逻辑:从session中取出查询的学生名字,调用studentService中的findByName()方法进行查询,并利用PageHelper插件进行分页处理,最后将查询结果封装到PageInfo对象中,在前端页面进行展示。

将查询的学生名字存入session中 RequestMappingsearchStudentName public void searchStudentNameRequestBody Student student HttpServletRequest request String username=studentgetUsername; 将要查找的姓名存入

原文地址: http://www.cveoy.top/t/topic/hjMQ 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录