我也遇到了相似的问题,出现错误
org.apache.jasper.JasperException: Unable to compile class for JSPGenerated servlet error:
D:\jboss-3.2.6\server\default\work\jboss.web\localhost\Product\org\apache\jsp\hello_jsp.java:102: 无法将 org.apache.jsp.hello_jsp 中的 _jspx_meth_c_out_0(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext,int[]) 应用于 (org.apache.taglibs.standard.tag.el.core.ForEachTag,javax.servlet.jsp.PageContext,int[])
          if (_jspx_meth_c_out_0(_jspx_th_c_forEach_0, _jspx_page_context, _jspx_push_body_count_c_forEach_0))
              ^
Generated servlet error:
D:\jboss-3.2.6\server\default\work\jboss.web\localhost\Product\org\apache\jsp\hello_jsp.java:106: 无法将 org.apache.jsp.hello_jsp 中的 _jspx_meth_c_out_1(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext,int[]) 应用于 (org.apache.taglibs.standard.tag.el.core.ForEachTag,javax.servlet.jsp.PageContext,int[])
          if (_jspx_meth_c_out_1(_jspx_th_c_forEach_0, _jspx_page_context, _jspx_push_body_count_c_forEach_0))
              ^
注意: D:\jboss-3.2.6\server\default\work\jboss.web\localhost\Product\org\apache\jsp\hello_jsp.java 使用了未经检查或不安全的操作。
注意: 要了解详细信息,请使用 -Xlint:unchecked 重新编译。
2 错误

解决方案 »

  1.   

    core:forEach 枚举的对象必须实现List接口(有人说是Map接口)
    反正总之是可以迭代的,作为例子可以运行下面的代码看看:<% java.util.ArrayList list = new java.util.ArrayList();
            list.add("a");
            list.add("b");
            list.add("c");
            list.add("d");
            list.add("e");
            list.add("f");
            pageContext.setAttribute("list", list, PageContext.PAGE_SCOPE);%>
    <c:forEach var="item" items="${list}" step="1">
      <c:out value="${item}">
      </c:out>
    </c:forEach>
      

  2.   

    试试不要用c标签输出,直接用${item}显示
      

  3.   

    刚刚遇到这个问题,发现是web。xml在作祟。
    表面上看web。xml没有问题,因为c:out都可以正常运行,但是我换成了另一个工程的web。xml
    就好用了。
      

  4.   

    找到原因了,web。xml里如果<?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
    就没有问题,
    如果<web-app>就不能显示。
      

  5.   

    request的含义就是在本次请求中有效啊