RKodakandla
RKodakandla

Reputation: 3484

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>
</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!

Upvotes: 1

Views: 2417

Answers (2)

yuwi
yuwi

Reputation: 21

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

Upvotes: 2

kalyan
kalyan

Reputation: 3106

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

Upvotes: 1

Related Questions