Note that there are some explanatory texts on larger screens.

plurals
  1. POspring form is not refilling on form submit
    primarykey
    data
    text
    <p>When I load this form, the countries table is populated from a database with 240 countries. if I submit it, with some empty required fields, the page reloads again with error messages. But i didnt get any country listed. I am using the same code to populate the list on the both the GET and POST methods -- see below</p> <pre><code> &lt;form:form commandName="student_personal_info" method="post"&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;&lt;form:label path="country"&gt;Country:&lt;/form:label&gt;&lt;/td&gt; &lt;td&gt;&lt;form:select path="country"&gt; &lt;form:option value="NONE" label=" --Select-- "&gt;&lt;/form:option&gt; &lt;form:options items="${countries}"/&gt; &lt;/form:select&gt; &lt;/td&gt; &lt;/tr&gt;&lt;/table&gt; &lt;/form:form&gt; @RequestMapping(value = "student_personal_info", method = RequestMethod.GET) public ModelAndView DisplayPersonalForm(ModelAndView model) { StudentPersonalInfo personalInfo = new StudentPersonalInfo(); model.addObject("student_personal_info", personalInfo); model.addObject("countries",getCountries()); return model; } //this works fine @RequestMapping(value = "student_personal_info", method = RequestMethod.POST) public String PersonalFormSubmitted( @ModelAttribute("student_personal_info") @Valid StudentPersonalInfo student_personal_info, BindingResult result, ModelAndView model) { model.addObject("countries", getCountries()); if (result.hasErrors()) { logger.info("From student personal info, there are " + String.valueOf(this.getCountries().size()) + " Countries"); //This prints 240 countries on the consule return "student_personal_info"; } else return "redirect:/display_program_of_study.tsegay"; } </code></pre> <p>all other my configuration works fine</p>
    singulars
    1. This table or related slice is empty.
    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.
    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