The method setItems(String) in the type ForTokensTag is not applicable for the arguments (Object)

1. 问题

看到这个错误以为是貌似jsp页面有误,c:forTokens标签用错了??

An error occurred at line: 444 in the jsp file: /WEB-INF/pages/countOrder/viewCountOrderDetails.jsp
The method setItems(String) in the type ForTokensTag is not applicable for the arguments (Object)
441:                                         </tr>
442:                                         </thead>
443:                                         <tbody>
444:                                         <c:forTokens items="${carBizNumprizeBase.driverAwardCondition}" delims="-"
445:                                                      var="driverAwardCondition" varStatus="status">

但是测试和预生产环境没有出现该问题,是否环境有问题?

2. 解决方法

在网上看到有说jstl.jar冲突的,在项目lib中确实有jstl1.2.jar但是tomcat的lib库及jdk的lib库中均没有改jar;

也看到说去掉standard.jar的,去掉了该包后点击原来有问题的jsp,页面出来了,但是旁边的菜单等点不了了;

standard.jar与jstl.jar不冲突(百度里又说jstl1.2以上不要standard)

最终在新的服务器部署项目 好了(用的是standard1.1.2和jstl1.2.jar)。

回过头看到上图,maven中央仓库没有standard1.2.3,后换成jstl1.1。

可能是环境多少有点问题 如与其他地方有不和谐, 但是没按标准组合使用jar 可能也造成使用出现上述问题

原文地址:https://www.cnblogs.com/rocky-fang/p/7776864.html