Community
Participate
Working Groups
Hello, WTP seems to validate the HTML tags and JSP tags balance at the same level. Consequential it can happen that WTP wrongly thinks that tags are unbalanced. You can reproduce it, using WTP 1.5.0 and create a new jsp, and paste the following: <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <body> <form> <jsp:forward page=""> </form> </jsp:forward> </body> </html> Line 7 will be marked as an error "Missing end tag jsp:forward". However, this code is valid. jsp:forward can be substituted by any other tag. Best Regards, Patric
FYI, I think this bug may warrant a note in documentation. See bug 153330.
*** Bug 154858 has been marked as a duplicate of this bug. ***
*** Bug 159067 has been marked as a duplicate of this bug. ***
*** Bug 167030 has been marked as a duplicate of this bug. ***
*** Bug 158325 has been marked as a duplicate of this bug. ***
This is still an issue that should be investigated.
The challenging part of this is knowing where things get paired up, and if they get paired up (in the case of conditional tags like <c:when>).
*** Bug 272701 has been marked as a duplicate of this bug. ***
*** Bug 352048 has been marked as a duplicate of this bug. ***
Hi, Nick Sandonato, this is not just about pairing. It's not as simple as that. It's really about "Levels". Each level of parsing must be done separately in order. Take a look of this simple example: <p title="<s:property value="foo.bar"/>"> The quick brown fox jumps over the lazy dog </p> For simple xml parsing, this is invalid, because a tag is not allowed to appear in the attribute of another tag. However, this is acceptable for jsp syntax, because all it cares is the <s:property value="foo.bar"/> part. The rest to jsp (<p title...) is just text/string regardless it is valid xml or not. If Eclipse wants to do parsing/colour coding/validating correctly for human users and supports both jsp level and xml/html levels, it has got to treat them separately. If one clever engineer may think they can still do a one-level parsing with the above example, then take a look at this crazier example (but runs well on server): <div <s:if test="foo.bar"> > The quick brown fox jumps over the lazy dog </div> </s:if> <s:else> class="clear"/> </s:else> Although this looks bad and I don't suggest anyone to follow this in practice, without parsing one level after another, I don't think any realistic practical parser can parse this correctly.
*** Bug 152102 has been marked as a duplicate of this bug. ***