title: c:forEach not working in tomcat 7
body: <p>I created simple page using <strong>c:forEach</strong> tag. Its working in tomcat 6. But <code>not working tomcat 7</code>.  Developed simple web application using JSF 2.0. </p>
  
  <p>I run my code in tomcat 6. its working.
  I deployed in tomcat 7. Its not working. c:forEach tag result not appearing.</p>
  
  <p><strong>welcomeJSF.jsp</strong></p>
  
  <pre><code>&lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
  &lt;%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%&gt;
  &lt;%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%&gt;
  &lt;%@taglib  uri="http://java.sun.com/jsp/jstl/core" prefix="c"%&gt;
  
  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;f:view&gt;
     &lt;html&gt;
        &lt;head&gt;
           &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/&gt;
        &lt;/head&gt;
        &lt;body&gt;
              &lt;h:form id="forEachForm" binding="#{simpleDemo.initForm}"&gt;
              &lt;c:forEach items="#{simpleDemo.userBeanList}" var="userBean"  varStatus="status"&gt;
                  &lt;h:panelGrid columns="2" border="1"&gt; 
  
                      &lt;h:outputText value="#{userBean.userName}"/&gt;
                      &lt;h:outputText value="#{userBean.role}"/&gt;
  
                  &lt;/h:panelGrid&gt;
  
              &lt;/c:forEach&gt;
  &lt;/h:form&gt;
   &lt;/body&gt;&lt;/html&gt;&lt;/f:view&gt;
  </code></pre>
  
  <p>I used the following jar</p>
  
  <pre><code>1. jsf-api.jar
  2. jsf-impl.jar
  3. jstl-1.2.jar
  4. standard.jar
  </code></pre>
  
  <p>web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt;
  
  &lt;context-param&gt;
      &lt;param-name&gt;javax.faces.PROJECT_STAGE&lt;/param-name&gt;
      &lt;param-value&gt;Development&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/faces/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;session-config&gt;
      &lt;session-timeout&gt;
          30
      &lt;/session-timeout&gt;
  &lt;/session-config&gt;
  &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;faces/welcomeJSF.jsp&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>faces-config.xml</strong></p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;
  &lt;faces-config version="2.0"
  xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns
  /javaee/web-facesconfig_2_0.xsd"&gt;
  
  &lt;managed-bean&gt;
      &lt;managed-bean-name&gt;simpleDemo&lt;/managed-bean-name&gt;
      &lt;managed-bean-class&gt;com.tomcat.foreach.SimpleDemo&lt;/managed-bean-class&gt;
      &lt;managed-bean-scope&gt;session&lt;/managed-bean-scope&gt;
  &lt;/managed-bean&gt;    
  &lt;/faces-config&gt;
  </code></pre>
  
  <p><strong>SimpleDemo.java</strong></p>
  
  <pre><code>package com.tomcat.foreach;
  
  import java.util.ArrayList;
  import java.util.List;
  import javax.faces.component.html.HtmlForm;
  
  public class SimpleDemo
  {
  private HtmlForm initForm;
  private List&lt;UserBean&gt; userBeanList = new ArrayList&lt;UserBean&gt;();    
  
  public HtmlForm getInitForm()
  {
      userBeanList.clear();
  
      UserBean userBean = new UserBean();
      userBean.setUserName("jack");
      userBean.setRole("sample Role");
      userBeanList.add(userBean);
  
      userBean = new UserBean();
      userBean.setUserName("adminuser");
      userBean.setRole("Admin Role");
      userBeanList.add(userBean);
  
      userBean = new UserBean();
      userBean.setUserName("Test User");
      userBean.setRole("Test role");
      userBeanList.add(userBean);
  
      return initForm;
  }
  
  public void setInitForm(HtmlForm initForm){
      this.initForm = initForm;
  }
  public List&lt;UserBean&gt; getUserBeanList(){
      return userBeanList;
  }
  public void setUserBeanList(List&lt;UserBean&gt; userBeanList){
      this.userBeanList = userBeanList;
  }  }       
  </code></pre>
  
  <p><strong>UserBean.java</strong></p>
  
  <pre><code>package com.tomcat.foreach;
  
  public class UserBean
  {
  private String userName;
  private String role;
  
  public String getUserName(){
      return userName;
  }
  public void setUserName(String userName){
      this.userName = userName;
  }
  public String getRole(){
      return role;
  }
  public void setRole(String role){
      this.role = role;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Help me,
  Thanks in advance.</p>