Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/main/java/com/system/controller/TeacherController.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,14 @@ public String passwordRest() throws Exception {
return "teacher/passwordRest";
}

//搜索课程
@RequestMapping(value = "selectCourse", method = {RequestMethod.POST})
private String selectCourse(String findByName, Model model) throws Exception {

List<CourseCustom> list = courseService.findByName(findByName);

model.addAttribute("courseList", list);
return "teacher/showCourse";
}

}
2 changes: 1 addition & 1 deletion src/main/webapp/WEB-INF/jsp/admin/showCourse.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<h1 class="col-md-5">课程名单管理</h1>
<form class="bs-example bs-example-form col-md-5" role="form" style="margin: 20px 0 10px 0;" action="/admin/selectCourse" id="form1" method="post">
<div class="input-group">
<input type="text" class="form-control" placeholder="请输入姓名" name="findByName">
<input type="text" class="form-control" placeholder="请输入课程名称" name="findByName">
<span class="input-group-addon btn" onclick="document.getElementById('form1').submit" id="sub">搜索</span>
</div>
</form>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/WEB-INF/jsp/teacher/showCourse.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<div class="panel-heading">
<div class="row">
<h1 class="col-md-5">我教授的课程</h1>
<form class="bs-example bs-example-form col-md-5" role="form" style="margin: 20px 0 10px 0;" action="/admin/selectCourse" id="form1" method="post">
<form class="bs-example bs-example-form col-md-5" role="form" style="margin: 20px 0 10px 0;" action="/teacher/selectCourse" id="form1" method="post">
<div class="input-group">
<input type="text" class="form-control" placeholder="请输入课程名" name="findByName">
<span class="input-group-addon btn" onclick="document.getElementById('form1').submit" id="sub">搜索</span>
Expand Down