displaycoursethrowawaycontroller.java

来自「spring in action 源代码」· Java 代码 · 共 27 行

JAVA
27
字号
package com.springinaction.training.mvc;import org.springframework.web.servlet.ModelAndView;import org.springframework.web.servlet.mvc.throwaway.ThrowawayController;import com.springinaction.training.model.Course;import com.springinaction.training.service.CourseService;public class DisplayCourseThrowawayController     implements ThrowawayController {  private Integer id;  public void setId(Integer id) { this.id = id; }    public ModelAndView execute() throws Exception {    Course course = courseService.getCourse(id);     return new ModelAndView("courseDetail", "course", course);  }    private CourseService courseService;  public void setCourseService(CourseService courseService) {    this.courseService = courseService;  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?