Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用ibatis在JSP中显示数据_Jsp_Spring Mvc_El_Ibatis - Fatal编程技术网

使用ibatis在JSP中显示数据

使用ibatis在JSP中显示数据,jsp,spring-mvc,el,ibatis,Jsp,Spring Mvc,El,Ibatis,嗨,我正在尝试使用ibatis在JSP中显示数据。 以下是我的contentstatisController.java页面 @RequestMapping(value="/contentStatis") public String contentStatis( HttpServletResponse response, ModelMap model, Condition condition, @RequestParam Ma

嗨,我正在尝试使用ibatis在JSP中显示数据。 以下是我的contentstatisController.java页面

    @RequestMapping(value="/contentStatis")
public String contentStatis(
        HttpServletResponse response,
        ModelMap model,
        Condition condition,
        @RequestParam Map<String, Object> maps) throws Exception { 

    if(!PotSessionUtils.isAdminLogin()) {
        PotSessionUtils.goAdminMainPage(response);
    } else {


logger.debug("=======================================================>");
        logger.debug("파라메타 확인(maps) ========> " + maps);

logger.debug("=======================================================>");

List<ContentStatis> result = ContentStatisRepository.statis(maps);
Pagination<ContentStatis> resultList = PaginationUtil.getPaginationList(result,         
condition, (long)result.size(), Order.DESC);

model.addAttribute("condition", condition);
model.addAttribute("resultList", resultList);

    }
    return "admin/statisMng/contentStatis";
}
现在,下面是JSP页面

(请注意,我只想显示week和WebNT)


你好
但由于某些原因,JSP页面只显示文本“Hello”

它们都不会出现在JSP中。concole中也没有错误消息

但是,colsole仍然显示我在xml页面中编写的整个查询


有人能帮我显示数据吗?我已经被困在这三天了…

您正在将模型属性设置为:

model.addAttribute("condition", condition);
model.addAttribute("resultList", resultList);
在JSP页面中,您可以通过以下方式访问它们:

${condition}
${resultList}
要访问
resultList
的任何属性,必须使用:

${resultList.property}  // property is a bean-style attribute of class whose object is resultList.
要访问
结果的
列表

List<ContentStatis> result = ContentStatisRepository.statis(maps);
然后,您可以在JSP中检索它,如下所示:

${result}
由于它是一个
列表
,因此必须使用JSTL迭代它并获取每个
ContentStatis
对象:

<c:forEach var="contentStatis" items="${result}" varStatus="i">
  Week: ${contentStatis.week} <!-- if contentStatis has week property  -->
  <br>webCnt: ${contentStatis.webCnt} <!-- if contentStatis has webCntproperty  -->
</c:forEach>

周:${contentStatis.Week}

webCnt:${contentStatis.webCnt}
我试过了。base.jsp具有以下特性:在控制器页面中,List result=ContentStatisRepository.statis(映射);我想到了这个。不是吗?谢谢你的回答。但是可以检查一下我刚刚更新的问题吗?我错过了一页要贴的内容。我现在刚刚更新了问题。我非常感谢你的帮助。
${resultList.property}  // property is a bean-style attribute of class whose object is resultList.
List<ContentStatis> result = ContentStatisRepository.statis(maps);
model.addAttribute("result", result);
${result}
<c:forEach var="contentStatis" items="${result}" varStatus="i">
  Week: ${contentStatis.week} <!-- if contentStatis has week property  -->
  <br>webCnt: ${contentStatis.webCnt} <!-- if contentStatis has webCntproperty  -->
</c:forEach>