- This topic has 7 replies, 3 voices, and was last updated 19 years, 11 months ago by dsarris.
-
AuthorPosts
-
dsarrisMemberHi,
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?
GregMemberWhere are you seeing that error? error log, problems view, console output, in the editor annotations, or other?
dsarrisMemberSorry for my late answer.
I am seeing it in the Problems View.
dsarrisMemberAny suggestions? Is the problem reproducable?
Riyad KallaMemberdsarris,
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?
dsarrisMembernop.
I can see the jstl.jar, standard.jar files in the WEB-INF/lib directory.
Riyad KallaMemberThat 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?
dsarrisMemberOk. You were correct. The libs were in the deployment, but not at the project classpath. I added them and I have no problems.
Thanks
-
AuthorPosts