在controller中通过ModelAndView返回到页面的值,在jsp页面怎么取不到值呢?
在controller中通过ModelAndView返回到页面的值,在jsp页面怎么取不到值呢?
controller代码如下
@RequestMapping(value="/courseinfo.do", method=RequestMethod.GET)
public ModelAndView courseinfo(int courseAutoid,int categoryAutoid,int learnrecAutoid,String typeKey){
List<Category> list=categoryService.getParents(categoryAutoid);
List<Category> cateList=Tools.sortOrder(list);
Map<String, Object> map=new HashMap<String, Object>();
map.put("cateList", cateList);
ModelAndView mav=new ModelAndView("student/course/courseinfo");
mav.addObject(map);
return mav;
}
jsp:
<c:forEach var="category" items="${cateList}" varStatus="state">
${category.cateName}
<c:if test="${!state.last}">
>
</c:if>
</c:forEach>