For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 4 replies, 2 voices, and was last updated 19 years, 2 months ago by
sofistek.
-
AuthorPosts
-
pdentiMemberHi,
I found a few problems with jsp & html validation going from eclipse 3.1, myeclipse 4.1 to eclipse 3.2, myeclipse 5.0M21) I cannot use anymore static jsp includes like <%@ include file=”/WEB-INF/jsp/includes/myTable.jspf”%>
i get errors like
a) Syntax error on token “}”, { expected
b) Syntax error, insert “Finally” to complete TryStatement2) i cannot use anymore jstl tags inside html tags like
<input type=”text” name=”<c:out value=”${status.expression}”/>” value=”<c:out value=”${status.value}”/>”<c:if test=”${status.error == true}”> class=”error”</c:if>/>
i get a “undefined attribute name” warning on the jstl part (<c:if test=”${status.error == true}”> class=”error”</c:if>)moreover, directories not included on the source path and not under WebRoot (actually including static html files, documentation, …) are now parsed for errors
I also tried to disable jsp fragments validation with no results
Thx
PDAugust 3, 2006 at 10:13 am #256056
pdentiMembermore info
a) the include errors are generated by the jsp validator
b) the warnings about jstl tags in html are generated by the html validator
if i disable those validators, i can work without false errors and warnings (but without validators …) and the documentation dir is not parsed anymore by the html validator.August 3, 2006 at 4:45 pm #256110
sofistekParticipantI’ve a feeling at least some of these may be genuine errors, from the validators point of view. I’ve had similar. Consider that a JSP is meant to be a genuine XML document, but most of the JSPs I’ve seen are not valid XML documents. For example, the construct:
<htmltag attr='<h:outputText value=”${status.expression}”/>’/>
is not a valid XML line. It would need to be:
<f:verbatim><htmltag attr='</f:verbatim><h:outputText value=”${status.expression}”/><f:verbatim>’/></f:verbatim>
For completness, you might even want to change the literal “>” character to “>” giving:
<f:verbatim><htmltag attr='</f:verbatim><h:outputText value=”${status.expression}”/><f:verbatim>’/></f:verbatim>
Of course, this makes the JSP very ugly but I can’t see a way round it, for true validation. I’m going to look for or start a thread on this.
See page 16 of the “Core JavaServer Faces” book, for a brief discussion of this topic.
Tony
August 3, 2006 at 4:53 pm #256114
pdentiMemberghosh !
you turned on my brain !!i have the feeling that you are, in some way, right.
May be i have never been thinking to your points because
1) too many years using inner tags in html and “non-xml jsp includes”
2) the previous validator version validated it and i “mechanically” started thinking to bugs in the new validatorbut, if you are right, your considerations are worth of a different, and much more interesting, thread !!
however i still have some doubts … it is true that my jsp pages are declared
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
but … why is the html validator giving errors about non compliant html even when parsing jsp documents ?moreover, why is the jsp validator asking for correct xml pages (it this is the correct diagnosis) , giving errors on non-xml includes ?
you say that “Consider that a JSP is meant to be a genuine XML document”. are you sure ? is it a 2.4 spec ? actually it is he first time that i read this.
and if you are right, it means that the <%@ directive syntax cannot be used any more.August 3, 2006 at 9:30 pm #256126
sofistekParticipantThinking about it, it may be that a JSP does not need to be an XML document. However, it is also not usually an XHTML document, as the <!DOCTYPE> declaration would indicate. Rather, an XHTML document is what is aimed to be produced by the JSP. This might be at least part of the issue.
If the document starts with an <?xml?> declaration, then it should be an XML document.
One question is: should the editors and validators be tolerant of “bad” JSP documents or should they insist that the rules be met?
Tony
-
AuthorPosts