Showing the URL of the view in the address bar, instead of the one of the action

Posted by aditya on Stack Overflow See other posts from Stack Overflow or by aditya
Published on 2010-12-21T04:20:09Z Indexed on 2010/12/21 6:54 UTC
Read the original article Hit count: 209

Filed under:
|
|
@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

© Stack Overflow or respective owner

Related posts about spring

Related posts about jsp