The function size must be used with a prefix when a default namespace is not specified
The function get must be used with a prefix when a default namespace is not specified
解决方法:
在EL表达式中${}调用了不能调用的方法,即,不可以这样 ${currentUser.sectionList.size()==0&¤tUser.type!=2 },${sectionTopicCount.get(section)} 而是要这样 ${currentUser.sectionList.size==0&¤tUser.type!=2 },${sectionTopicCount.section}要省略括号和get,也就是直接用模型里面的属性就可以了,才能正确运行!
获取List长度
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
${fn:length(currentUser.sectionList)}
本文介绍了如何正确使用EL表达式来获取List长度等操作,强调了在没有默认名称空间的情况下调用方法时需要遵循的规范,并提供了一个具体的示例。
3647

被折叠的 条评论
为什么被折叠?



