看着泉水樣本應用寵物護理。春季寵物護理樣本,控制器操作如何與jsp鏈接?
患者控制器看起來像:
包org.springframework.samples.petcare.clients.patients;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
@RequestMapping(value = "/owners/{ownerId}/patients/{patient}")
public class PatientController {
private final PatientRepository repository;
@Autowired
public PatientController(PatientRepository repository) {
this.repository = repository;
}
@RequestMapping(method = RequestMethod.GET)
public Patient get(Long ownerId, String patient) {
return repository.getPatient(ownerId, patient);
}
@RequestMapping(value = "/edit", method = RequestMethod.GET)
public Patient getForEditing(Long ownerId, String patient) {
return repository.getPatient(ownerId, patient);
}
@RequestMapping(method = RequestMethod.PUT)
public void update(Patient patient) {
repository.savePatient(patient);
}
@RequestMapping(method = RequestMethod.DELETE)
public void delete(Long ownerId, String patient) {
}
}
到底鏈接到jsp的動作究竟是什麼?