org.apache.jasper.JasperException: Unable to compile class for JSP:
2016-03-12 21:26
633 查看
The method setItems(String) in the type ForTokensTag is not applicable for the arguments (Object):
无意间学习JSTL的时候出了这个错,花了很长时间,在网上也百度好久,发现报org.apache.jasper.JasperException: Unable to compile class for JSP:错误的好多,但是真正和我的出错有关的是下面内容的第一行报错,所以这里我把它复制下来写到第一行,
代码如下:
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<body>
<h2>Hello World!</h2>
<c:forTokens items="我,在,上,海,你,在,哪" delims="," var="val">
<c:out value="${val}"></c:out>
<br />
</c:forTokens>
<hr />
</body>
</html>
报错页面如下
经过几个小时的奋斗,终于找到原因,原来是我的jstl.jar多了,javaEE Libraries 本身含有jstl.jar,我自己又添加了jstl.jar包,
导致报出此类错误,如果报出org.apache.jasper.JasperException: Unable to compile class for JSP错误,首先要看看紧跟着的错误是什么,就像我的错误是The
method setItems(String) in the type ForTokensTag is not applicable for the arguments (Object):最后发现是jstl.jar多了,如果是别的错误,此中方法不管用。
无意间学习JSTL的时候出了这个错,花了很长时间,在网上也百度好久,发现报org.apache.jasper.JasperException: Unable to compile class for JSP:错误的好多,但是真正和我的出错有关的是下面内容的第一行报错,所以这里我把它复制下来写到第一行,
代码如下:
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<body>
<h2>Hello World!</h2>
<c:forTokens items="我,在,上,海,你,在,哪" delims="," var="val">
<c:out value="${val}"></c:out>
<br />
</c:forTokens>
<hr />
</body>
</html>
报错页面如下
经过几个小时的奋斗,终于找到原因,原来是我的jstl.jar多了,javaEE Libraries 本身含有jstl.jar,我自己又添加了jstl.jar包,
导致报出此类错误,如果报出org.apache.jasper.JasperException: Unable to compile class for JSP错误,首先要看看紧跟着的错误是什么,就像我的错误是The
method setItems(String) in the type ForTokensTag is not applicable for the arguments (Object):最后发现是jstl.jar多了,如果是别的错误,此中方法不管用。
相关文章推荐
- JSP/PHP基于Ajax的分页功能实现
- 开发阶段Jetty运行Jsp报错且响应空白
- jsp简单实现页面之间共享信息的方法
- Apache Web让JSP“动”起来
- JSP学习经验小结分享
- JSP 多条SQL语句同时执行的方法
- 在jsp页面中响应速度提高的7种方法分享
- (jsp/html)网页上嵌入播放器(常用播放器代码整理)
- JSP上传excel及excel插入至数据库的方法
- JSP中文乱码常见3个例子及其解决方法
- jsp实现将动态网页转换成静态页面的方法
- JSP避免Form重复提交的三种方案
- 纯jsp实现的倒计时动态显示效果完整代码
- JSP自定义标签入门学习
- JSP实现添加功能和分页显示实例分析
- JSP中param标签用法实例分析
- JSP实现从不同服务器上下载文件的方法
- jsp 标准标签库简析