facebook

Struts – foreachtag error [Closed]

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #222034 Reply

    dsarris
    Member

    Hi,

    I am using Struts 1.2 and I have implemented a JSP page containg the <c:foreachtag>:

    <%@ page language="java"%>
    
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-template" prefix="template" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-nested" prefix="nested" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html:html locale="true">
      <head>
        <html:base />
        
        <title>displayCountries.jsp</title>
        
        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0">    
        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="This is my page">
      </head>
      
      <body>
          <html:errors/>
          <table border="1" width="100%">
            <tr>
              <th>
              CountryId
              </th>
              <th>
              CountryName
              </th>
              <th>          
              </th>
            </tr>
            <c:forEach var="Country" items="${countryList.map.countries}">
              <tr>
                <td>
                  <c:out value="${Country.id}"/>
                </td>
                <td>
                  <c:out value="${Country.countryName}"/>
                </td>        
                <td>
                
                <html:form action="/selectCountry">
                    <table>
                    <tr>
                    <td>
                    <html:text property="countryId" value="${Country.id}" />
                    </td>
                    <td>
                    <html:select property="maritalStatusId">
                            <html:optionsCollection
                                name="athleteOption"
                                property="maritalStatus"
                                label="name" 
                                value="id"/>
                    </html:select>
                    </td>
                    </tr>
                    </table>
                    <html:submit value="Select"/>
                    
                </html:form>
                </td>    
              </tr>
            </c:forEach>
            
          </table>
      </body>
    </html:html>

    MyEclipse complais with the following error:

    package org.apache.taglibs.standard.tag.rt.core does not exist:  org.apache.taglibs.standard.tag.rt.core.ForEachTag _jspx_th_c_forEach_0 = (org.apache.taglibs.standard.tag.rt.core.ForEachTag) _jspx_tagPool_c_forEach_var_items.get(org.apache.taglibs.standard.tag.rt.core.ForEachTag.class);

    However, if I ignore this error and deploy to JBoss, everything works OK.

    How can solve this error?

    #222121 Reply

    Greg
    Member

    Where are you seeing that error? error log, problems view, console output, in the editor annotations, or other?

    #222400 Reply

    dsarris
    Member

    Sorry for my late answer.

    I am seeing it in the Problems View.

    #222529 Reply

    dsarris
    Member

    Any suggestions? Is the problem reproducable?

    #222537 Reply

    Riyad Kalla
    Member

    dsarris,
    Most likely you forgot to add the jstl.jar and/or the standard.jar files to your Java Build Path for your project; and JBoss probably provides these files by default so when the app is deployed, it just uses the JBoss libraries.

    Is this the case?

    #222546 Reply

    dsarris
    Member

    nop.
    I can see the jstl.jar, standard.jar files in the WEB-INF/lib directory.

    #222548 Reply

    Riyad Kalla
    Member

    That doesn’t necessarily mean it is in your Build Path, please double check your Project Properties > Java Build Path > Libraries settings and see if jstl.jar and standard.jar are listed. If not, use Add JAR and add them then rebuild your project.

    What version of the JSTL JARs are you using?

    #222585 Reply

    dsarris
    Member

    Ok. You were correct. The libs were in the deployment, but not at the project classpath. I added them and I have no problems.

    Thanks

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: Struts – foreachtag error [Closed]

You must be logged in to post in the forum log in