displayinstructorcontroller.java
来自「Spring in Action 源码」· Java 代码 · 共 34 行
JAVA
34 行
package com.springinaction.training.mvc;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;
import com.springinaction.training.model.Instructor;
import com.springinaction.training.service.InstructorService;
public class DisplayInstructorController
extends AbstractController {
public DisplayInstructorController() {}
protected ModelAndView handleRequestInternal(HttpServletRequest request,
HttpServletResponse response) throws Exception {
String login = request.getParameter("id");
Instructor instructor = instructorService.getInstructor(login);
return new ModelAndView("instructorDetail", "instructor", instructor);
}
// INJECTED
private InstructorService instructorService;
public void setInstructorService(InstructorService instructorService) {
this.instructorService = instructorService;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?