Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to prevent confirm alert In Spring MVC on F5
    primarykey
    data
    text
    <p>In Spring I usually did a redirect-after-submit(get method <code>mapping</code>) to prevent the user of submitting a form , but when i pressing <code>F5</code> it will go to get method <code>mapping</code> again and display me this kind of confirm message. how could i prevent this message every time on <code>F5</code>.</p> <p><img src="https://i.stack.imgur.com/pdtoF.png" alt="enter image description here"></p> <p>Here is the code for controller -</p> <pre><code> ScheduleDetail objScheduleDetail = new ScheduleDetail(); HttpSession session = request.getSession(true); String condition = ""; try{ int careProfessionalIDF = (Integer) session.getAttribute("careProfessionalIDF"); condition = "CareProfessionalIDF = "+careProfessionalIDF; objScheduleDetail.setCareProfessionalIDF(careProfessionalIDF); }catch (Exception e) { int careProviderIDF = (Integer) session.getAttribute("careProviderIDF"); condition = "CareProviderIDF = "+careProviderIDF; objScheduleDetail.setCareProviderIDF(careProviderIDF); } List&lt;ScheduleDetail&gt; ScheduleDetailList = objScheduleDetailManager.getAllScheduleDetail(condition+" ORDER BY ScheduleDetailIDP DESC"); model.addObject("List_of_ScheduleDetail",ScheduleDetailList); model.addAttribute("ScheduleDetail", objScheduleDetail); return "hospital/scheduleDetail";//jsp page </code></pre> <p><strong>edited code</strong></p> <pre><code> @RequestMapping("/editAddressType.html") public String editAddressType(ModelMap model,HttpServletRequest request) { int addressTypeIDP = Integer.parseInt(request.getParameter("AddressTypeIDP")); AddressType objAddressType = new AddressType(); objAddressType = objAddressTypeManager.getByID(addressTypeIDP); model.addAttribute("AddressType", objAddressType); return "jsp/addressType"; it open addressType.jsp with data tht we bind with `model.addAttribute`. now if i press F5 it show alert message as above image. **get method** @RequestMapping(value="/getAddressType.html", method=RequestMethod.GET) public String getAddressType(ModelMap model, HttpServletRequest request) throws RemoteException { AddressType objAddressType = new AddressType(); model.addAttribute("AddressType", objAddressType); return "hospital/addressType"; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload