JSP form going as empty randomly after submitting with post request. I am using springboott with embedded tomcat in a openshift container. I have seen similar request in 2016 but no reply. Any help is highly appreciated.
JSP:
<textarea id="dataArea" cols="111" rows="28" name="data" Class="prj" onkeydown="limitCounter(this, countdown);" onkeyup="limitText(this, countdown);" onchange="limitText(this, countdown);" onclick="trueCount(this, countdown);">${frm.data}</textarea>
<a href="#" accesskey="S" onfocus="javascript:saveData()" tabindex="-1"></a>
<img src="/prj/web/images/data_button.gif" border="0" style="cursor:hand" title="ALT + S" onclick="javascript:saveData()">
Javascripts:
function saveComments()
{ document.forms[0].action='<%=contextPath%>/saveData';
document.forms[0].submit(); self.close();
}
Controller:
@RequestMapping(value = "/saveData", method ={RequestMethod.POST})
public ModelAndView saveData(ModelMap modelMap, @ModelAttribute("frm") dataForm frm, BindingResult bindingResult, HttpServletRequest request, HttpServletResponse response)
throws Exception { }
We had both these RequestMethod.GET and RequestMethod.POST and removed the GET from the controller, but it did not work.
This code is working fine for 50 to 60 occurrences and the next one fails and the form is empty. We have enabled the logger and it showed the empty form. The immediate next action is working fine. Note: This action is performed from the popup screen. Please let me know if you need any more details