开发者

ModelMap attribute not passing the value

I am having issues with modelmap attributes.. this is my xyz.jsp file..

<select name="list">
   <option value="-">Choose a Value</option>
   <c:forEach items="${sectionList}" var="section">
   <option value="${section.code}">${section.description}</option>
   </c:forEach>
<开发者_StackOverflow;/select>

and the controller class...

 @RequestMapping(value="index", method = RequestMethod.GET)
  public String mainList(ModelMap modelMap){
     modelMap.addAttribute("sectionList", sectionService.getAllSectionList());
     return "home";
  }

But on the web page I don't see the options in the drop down.. All I see is only one value saying "${section.description}".. infact this is the source in html..

<select name="division" >
  <option value="-">Choose a Value</option>
  <option value="${section.code}">${section.description}</option>
</select>

Any help on what am I doing wrong here? Thanks!


did you try <c:out value="${section.[attribue]}/>? otherwise it will be displayed as string.


It looks like you dont have jstl-{version}.jar in your lib folder.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜