- This topic has 4 replies, 3 voices, and was last updated 16 years, 1 month ago by Loyal Water.
-
AuthorPosts
-
NemiMemberI am getting a validation error when using jstl tags in my jsp page. It says that the “missing end tag c:forEach” and “missing end tag c:if”. These tags are closed, but the table tag inside them is split between the inside and outside of the tag and this may be causing the problem. Here is my jsp:
<%@ page language="java" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib prefix="un" uri="http://jakarta.apache.org/taglibs/unstandard-1.0" %> <un:useConstants var="const" className="CustomerStatementDTO"/> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <c:choose> <c:when test='${fn:startsWith(statement.batchId, "Q")}'> <title>Royalty Statement - ${statement.quarterId}</title> </c:when> <c:otherwise> <title>Monthly Sales History - ${statement.batchId}</title> </c:otherwise> </c:choose> <meta http-equiv="pragma" content="no-cache"/> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="expires" content="0"/> <style type="text/css"> body { background-color: #fff; font: normal small courier, mono-spaced; } a:link, a:active, a:visited, a:hover { color: blue; text-decoration: underline; } </style> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td align="right"> <font face="Courier New" size="4"><b> <c:choose> <c:when test='${fn:startsWith(statement.batchId, "Q")}'> Royalty Statement </c:when> <c:otherwise> Monthly Sales History </c:otherwise> </c:choose> </b> </font> </td> </tr> </table> <br /> <br /> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td> ${statement.customer.firstName} ${statement.customer.MI} ${statement.customer.lastName} <br /> ${statement.customer.address} <br /> ${statement.customer.city} ${statement.customer.state} ${statement.customer.zip} <br /> ${statement.customer.countryCode} </td> <td> </td> <td width="400"> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td> <a href="#" onmouseover="return escape('The date on which this statement was posted.')" onclick=" return false">Statement Date:</a> </td> <td> <fmt:formatDate value="${statement.statementDate}"/> </td> </tr> <tr> <td> <a href="#" onmouseover="return escape('The Statement period reported for this statement.')" onclick=" return false">Period:</a> </td> <td> <fmt:formatDate value="${statement.periodStart}"/> - <fmt:formatDate value="${statement.periodEnd}"/> </td> </tr> <tr> <td> <a href="#" onmouseover="return escape('This is the id that uses to identify each author.')" onclick=" return false">iUniverse ID:</a> </td> <td> ${statement.customer.idNumber} </td> </tr> <tr> <td> <a href="#" onmouseover="return escape('This is the e-mail address that has on file for each author.')" onclick=" return false">Email Login:</a> </td> <td> ${statement.customer.emailId} </td> </tr> <tr> <td> </td> <td> </td> </tr> </table> </td> </tr> </table> <c:forEach items="${statement.titles}" var="title" varStatus="status" > <c:if test="${status.count == 1}" > <br/> <table border=1 cellspacing=0 cellpadding=0 width=100%> <tr> <td> <table border=0 cellspacing=0 cellpadding=0 width=100%> <tr> <td colspan=6 width=100% > <a href=# onmouseover="return escape('Summary of Your Book Sales')" onclick="return false"><b> Summary of Your Book Sales</b></a> </td> </tr> <tr> <td colspan=6 width=100% > <b> </b> </td> </tr> <tr> <td width=20% > <a href=# onmouseover="return escape('Primary Author Name')" onclick=" return false"><b> Author</b></a> </td> <td width=40%> <a href=# onmouseover="return escape('Title')" onclick=" return false"><b> Title</b></a> </td> <td width=10% align=right> <a href=# onmouseover="return escape('This Month Royalty.')" onclick=" return false"><b> Royalty</b></a> </td> <td width=10% align=right> <a href=# onmouseover="return escape('This Month Sales.')" onclick=" return false"><b> MTD Qty</b></a> </td> <td width=10% align=right> <a href=# onmouseover="return escape('This Year Sales')" onclick=" return false"><b> YTD Qty</b></a> </td> <td width=10% align=right> <a href=# onmouseover="return escape('Life times Sales(from 2002).')" onclick=" return false"><b> LTD Qty</b></a> </td></tr> </c:if> <c:choose> <c:when test="${status.count % 2 == 0}"> <c:set var="bgColor" value="#CCCCCC"/> </c:when> <c:otherwise> <c:set var="bgColor" value=""/> </c:otherwise> </c:choose> <tr bgcolor="${bgColor}"> <td align=left> ${title.authorName}</td> <td align=left> ${title.title}</td> <td align=right> <fmt:formatNumber value="${title.royaltyTotal}" type="currency"/> </td> <td align=right> ${title.mtd} </td> <td align=right> ${title.ytd} </td> <td align=right> ${title.ltd} </td></tr> </c:forEach> <tr> <td align=left> <b>Total</b> </td> <td align=left> </td> <td align=right> <b> <fmt:formatNumber value="${statement.royaltyTotalForAllTitles}" type="currency"/></b> </td> <td align=right> </td> <td align=right> </td> <td align=right> </td> </tr> </table> </td></tr></table> </body> </html>
Loyal WaterMemberCan you go to MyEclipse > Installation Summary > Installation Details and paste the information here for me.
pierre.henryMemberHello,
I have exactly the same problem, and I would like to know if it there is any news about this issue ?
Currently my whole project is without validation error except 3-4 errors of that type. But in the package explorer view, unless you unfold everything until the jsp file level, the whole webroot dir always appear red. Not very practical to detect real errors…
The structure is always the same, for example :
<c:forEach items="${displayObject.newsItems}" var="item"> <c:choose> <c:when test="${item.publishedNow}" > <div class="newsItemTitleBar published"> </c:when> <c:otherwise > <div class="newsItemTitleBar unpublished"> </c:otherwise> </c:choose> rest of the content of the div.... </div> </c:forEach>
The c:forEach opening tag is flagged with “missing end tag”.
Another case is where I order items in 4 columns in a table :
<c:forEach items="${roles}" var="role" varStatus="status"> <c:if test="${status.count % 4 == 1}" > <tr> </c:if> <td width="25%"> <html:multibox property="selectedRoles" disabled="false"> <bean:define id="hiddenValue" name="role" property="id" /> <bean:define id="dscr" name="role" property="name" /> <bean:write name="hiddenValue" /> </html:multibox> <bean:write name="dscr" /> </td> <c:if test="${status.count % 4 == 0 or status.last}" > </tr> </c:if> </c:forEach>
Here the closing line tag </tr> is flagged with “no start tag”
It would be nice to have this kind of problems fixed, or to have the possibility to mark them to be ignored…
Regards,
pierre.henryMemberSorry I forgot : I have just installed ME 6.5.1 GA before posting the previous post. So my installation details are :
*** Date:
Thursday, October 16, 2008 9:36:43 AM CEST** System properties:
OS=WindowsXP
OS version=5.1
Java version=1.5.0_11*** MyEclipse details:
MyEclipse Enterprise Workbench
Version: 6.5.1 GA
Build id: 6.5.1-GA-20080715*** Eclipse details:
MyEclipse Enterprise WorkbenchVersion: 6.5.1 GA
Build id: 6.5.1-GA-20080715Eclipse Platform
Version: 3.3.3.r33x_r20080129-_19UEl7Ezk_gXF1kouft
Build id: M20080221-1800Eclipse RCP
Version: 3.3.3.r33x_r20080129-8y8eE9UEUWI6qujeED0xT7bc
Build id: M20080221-1800Eclipse Java Development Tools
Version: 3.3.2.r33x_r20080129-7o7jE7_EDhYDiyVEnjb1pFd7ZGD7
Build id: M20080221-1800Eclipse Plug-in Development Environment
Version: 3.3.3.r33x_r20080129-7N7M5DQVIA_6oJsEFkEL
Build id: M20080221-1800Eclipse Project SDK
Version: 3.3.3.r33x_r20080129-7M7J7LB-u3aphGW6o3_VmiVfGXWO
Build id: M20080221-1800Eclipse Graphical Editing Framework
Version: 3.3.2.v20080129
Build id: 20080221-1602Eclipse startup command=-os
win32
-ws
win32
-arch
x86
-showsplash
-launcher
D:\java\MyEclipse6.5.1\eclipse\eclipse.exe
-name
Eclipse
–launcher.library
D:\java\MyEclipse6.5.1\eclipse\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.3.R33x_v20080118\eclipse_1023.dll
-startup
D:\java\MyEclipse6.5.1\eclipse\plugins\org.eclipse.equinox.launcher_1.0.1.R33x_v20080118.jar
-exitdata
14fc_74
-clean
-vm
D:\java\MyEclipse6.5.1\jre\bin\javaw.exe
Loyal WaterMemberI just checked up with the dev team and it seems like this is a limitation of the HTML validator at this time not being jsp taglib friendly. The temporary workaround until we get that code improved is to disable it completely for the project. Sorry for the inconvenience.
-
AuthorPosts