- This topic has 6 replies, 4 voices, and was last updated 18 years, 10 months ago by
Riyad Kalla.
-
AuthorPosts
-
afrassoMemberI’ve spent some time attempting to get rid of some JSP warnings I’m getting from MyEclipse (I’m using Eclipse version 3.1.2, and MyEclipse version 4.1.1). Since I’m certainly not an expert on JSP or HTML, I assumed the problem was mine.
I am using two JSP fragments in my JSP pages. They are written as follows:
head.jspf:
<%@ page contentType="text/html; charset=UTF-8" %> <%@ page pageEncoding="UTF-8" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="/WEB-INF/tld/struts/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/tld/struts/struts-logic.tld" prefix="logic" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Emptoris Project Status Web Site</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body>
tail.jspf
</body> </html>
Here is a simplified version of a JSP page I have written, called Test.jsp:
<%@ include file="include/head.jspf" %> <div class="heading"> Welcome to my test page. </div> <p>Please choose from the following actions:</p> <ul> <li><a href="doSomething.jsp">Do Something</a></li> <li><a href="doSomethingElse.jsp">Do Something Else</a></li> </ul> <%@ include file="include/tail.jspf" %>
In the above JSP, I get 3 warnings. The first, on line 3, states that the <div> tag is in an invalid location. The second, on line 7, states that the <p> tag is in an invalid location. Finally, the third warning states that on line 8 the <ul> tag is in an invalid location. I spent some time trying to figure out what I might be doing wrong.
Finally, I thought the use of JSP fragments might be causing trouble. I was right. The following JSP generates no warnings:
<%@ page contentType="text/html; charset=UTF-8" %> <%@ page pageEncoding="UTF-8" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="/WEB-INF/tld/struts/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/tld/struts/struts-logic.tld" prefix="logic" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>My Test Page</title> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <div class="heading"> Welcome to my test page. </div> <p>Please choose from the following actions:</p> <ul> <li><a href="doSomething.jsp">Do Something</a></li> <li><a href="doSomethingElse.jsp">Do Something Else</a></li> </ul> </body> </html>
Am I correct in thinking this might be some kind of bug? Is there a workaround so that the JSP Fragments won’t cause warnings to be generated? Or is there something else I might be missing here?
Thanks for all of your help.
Regards,
Anthony FrassoAugust 23, 2006 at 3:56 pm #257479
Riyad KallaMemberAnthony,
Your code is fine, the problem is the HTML Validator is not intelligent (yet) about fragments, and tries to validate pages stand-alone, which with fragments is not valid. My suggestion would be to disable the HTML validation for now.August 24, 2006 at 8:28 am #257542
arjan.tijmsMemberRiyad, do you already have a timeline for when the HTML Validator will properly process fragments?
I wonder though, since WTP is used for the low-level ‘web tooling’, is Genuitec going to implement this or is this on the WTP team’s list?
August 24, 2006 at 3:21 pm #257569
Riyad KallaMemberRiyad, do you already have a timeline for when the HTML Validator will properly process fragments?
Unfortunately no, not at this time.
I wonder though, since WTP is used for the low-level ‘web tooling’, is Genuitec going to implement this or is this on the WTP team’s list?
It’s a good question, everything we do that WTP ends up doing later is wasted money and deadweight on our development team so we are sensative to this. *However* there have been plenty of times when an outstanding bug is driving our users crazy so we have to step in and fix it or offer some other solution. Given how many times this has been asked for we will most likely wait for the 1.5.1 release of WTP to see if it’s gotten better before deciding on tackling the next step.
That being said, if a big enterprise customer comes to us tommorow an says “fix it”… it will get fixed.
August 25, 2006 at 5:00 pm #257639
afrassoMemberThanks for the update. Glad to hear that I understand more than I thought! 🙂
Regards,
Anthony FrassoAugust 26, 2006 at 3:48 am #257655
augustientjeMember@support-rkalla wrote:
*However* there have been plenty of times when an outstanding bug is driving our users crazy so we have to step in and fix it […]
That being said, if a big enterprise customer comes to us tommorow an says “fix it”… it will get fixed.In both cases, wouldn’t it allow you to contribute the fix back to the WTP project? That way you may state that Genuitec is ‘officialy’ helping with the OS WTP project. Also, it sounds like the MyEclipse and WTP teams are not really cooperating that closely (you said to wait for what they’ll come up with).
Of course the next suggestion involves pollitics of which I have no idea, but wouldn’t it be an option to have a Genuitec developper as a direct member of the WTP team? That way, work wouldn’t be wasted. Some parts would just be initiated before other parts.
I know some other companies do this, i.e. having their people working directly for some open source project in which they have a special interest.
August 26, 2006 at 9:47 am #257663
Riyad KallaMemberaugustientje,
This isn’t far off from how it is now and has been for a while, maybe I just didn’t do a good job explaining the situation. -
AuthorPosts