code_junkie

Spring MVC Form tags: Is there a standard way to add “No selection” item?

Nov 11th, 2011
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. protected Map referenceData(HttpServletRequest httpServletRequest, Object o, Errors errors) throws Exception {
  2. Map<String, Object> map = new HashMap<String, Object>();
  3.  
  4. map.put("countryList", Arrays.asList(Country.values()));
  5.  
  6. return map;
  7. }
  8.  
  9. <form:select path="country" items="${countryList}" title="country"/>
  10.  
  11. <form:select path="country" title="country" >
  12. <form:option value="">&nbsp;</form:option>
  13. <form:options items="${countryList}" />
  14. </form:select>
Add Comment
Please, Sign In to add comment