在地址栏中显示视图的 URL,而不是操作的 URL
@RequestMapping(value = "updatePatient", method = RequestMethod.POST)
public ModelAndView postUpdatePatientById(
@ModelAttribute("patient") PatientForm patientForm,
HttpSession session) {
Long id = (Long) session.getAttribute("refId");
if (id != 0 || id != null) {
Patient patient1 = HospitalPatientHelper
.getPatientFrom_PatientForm(patientForm);
patientService.updatePatient(patient1, id);
PatientService patientService) {
Patient patient = patientService.getPatientById(id);
ModelAndView mv;
PatientForm patientForm = HospitalPatientHelper
.getPatientForm_FromPatient(patient);
List<Weight> weights = patientService.viewLast10RecordedWeight(patient);
WeightTable weightTable = new WeightTable();
List<WeightSummaryTable> summaryWeights = weightTable.summary(weights,
patient.getHeight());
mv = new ModelAndView("patient1/patientDetail");
mv.addObject("patient", patientForm);
mv.addObject("summaries", summaryWeights);
mv.addObject("lastWeight", summaryWeights.get(0).getWeight());
mv.addObject("bmi", summaryWeights.get(0).getBmi());
return mv;
} else {
return new ModelAndView("patient1/patientDetail");
}
}
页面成功显示,但 url 没有改变,意味着 url 没有显示地址 www.url.com/Patient1/PatientDetail.htm
并且我希望返回的视图地址也应该是也显示在网址中。
请帮我
@RequestMapping(value = "updatePatient", method = RequestMethod.POST)
public ModelAndView postUpdatePatientById(
@ModelAttribute("patient") PatientForm patientForm,
HttpSession session) {
Long id = (Long) session.getAttribute("refId");
if (id != 0 || id != null) {
Patient patient1 = HospitalPatientHelper
.getPatientFrom_PatientForm(patientForm);
patientService.updatePatient(patient1, id);
PatientService patientService) {
Patient patient = patientService.getPatientById(id);
ModelAndView mv;
PatientForm patientForm = HospitalPatientHelper
.getPatientForm_FromPatient(patient);
List<Weight> weights = patientService.viewLast10RecordedWeight(patient);
WeightTable weightTable = new WeightTable();
List<WeightSummaryTable> summaryWeights = weightTable.summary(weights,
patient.getHeight());
mv = new ModelAndView("patient1/patientDetail");
mv.addObject("patient", patientForm);
mv.addObject("summaries", summaryWeights);
mv.addObject("lastWeight", summaryWeights.get(0).getWeight());
mv.addObject("bmi", summaryWeights.get(0).getBmi());
return mv;
} else {
return new ModelAndView("patient1/patientDetail");
}
}
the page shown sucessfully, but the url dosn't change, means the url is not showing the address www.url.com/patient1/patientDetail.htm
and i want that the returning view address should also be shown in the url too.
please help me
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
或
Use either
Or