课程信息查询功能完成
修复jsp上的错误 修复CourseController上的错误 Signed-off-by: Chenx221 <chenx221@yandex.com>
This commit is contained in:
parent
191c4f3d91
commit
19049f907e
Binary file not shown.
Binary file not shown.
@ -12,6 +12,7 @@
|
||||
<mappers>
|
||||
<mapper resource="mapper/UserMapper.xml"/>
|
||||
<mapper resource="mapper/StudentMapper.xml"/>
|
||||
<mapper resource="mapper/CourseMapper.xml"/>
|
||||
<!-- 可以添加其他的映射器配置 -->
|
||||
</mappers>
|
||||
</configuration>
|
||||
|
@ -143,9 +143,9 @@
|
||||
<tbody>
|
||||
<c:forEach var="course" items="${courses}">
|
||||
<tr>
|
||||
<td>${course.CourseID}</td>
|
||||
<td>${course.CourseName}</td>
|
||||
<td>${course.Description}</td>
|
||||
<td>${course.courseID}</td>
|
||||
<td>${course.courseName}</td>
|
||||
<td>${course.description}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
|
@ -2,6 +2,7 @@ package cyou.chenx221.controller;
|
||||
|
||||
import cyou.chenx221.pojo.Course;
|
||||
import cyou.chenx221.service.CourseService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -14,6 +15,7 @@ import java.util.List;
|
||||
public class CourseController {
|
||||
private final CourseService courseService;
|
||||
|
||||
@Autowired
|
||||
public CourseController(CourseService courseService) {
|
||||
this.courseService = courseService;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package cyou.chenx221.service;
|
||||
|
||||
import cyou.chenx221.mapper.CourseDao;
|
||||
import cyou.chenx221.mapper.StudentDao;
|
||||
import cyou.chenx221.pojo.Course;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -10,6 +11,11 @@ import java.util.List;
|
||||
public class CourseService {
|
||||
private CourseDao courseDao;
|
||||
|
||||
public CourseService(CourseDao courseDao) {
|
||||
this.courseDao = courseDao;
|
||||
}
|
||||
|
||||
|
||||
public List<Course> getAllCourses() {
|
||||
return courseDao.getAllCourses();
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
<mappers>
|
||||
<mapper resource="mapper/UserMapper.xml"/>
|
||||
<mapper resource="mapper/StudentMapper.xml"/>
|
||||
<mapper resource="mapper/CourseMapper.xml"
|
||||
<mapper resource="mapper/CourseMapper.xml"/>
|
||||
<!-- 可以添加其他的映射器配置 -->
|
||||
</mappers>
|
||||
</configuration>
|
||||
|
@ -143,9 +143,9 @@
|
||||
<tbody>
|
||||
<c:forEach var="course" items="${courses}">
|
||||
<tr>
|
||||
<td>${course.CourseID}</td>
|
||||
<td>${course.CourseName}</td>
|
||||
<td>${course.Description}</td>
|
||||
<td>${course.courseID}</td>
|
||||
<td>${course.courseName}</td>
|
||||
<td>${course.description}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
|
Reference in New Issue
Block a user