facebook

JSP Validation issue…

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #267949 Reply

    Hello,

    When editing a JSP in the MyEclipse JSP Editor, all HTML tags are marked as invalid: Unknown tag. In researching why this may be happening, I found the Help section entitled, “Working with Web Projects” under the JEE Application Development/Getting Started area of the MyEclipse Learning Center. In this section the screenshots explicity show the HTML validation as disabled (and hence, no HTML errors in the screenshots). While this does work, my question is why does the JSP Editor incorrectly flag valid HTML as being invalid? Why do I need to physically disable the validation of the HTML in order to have the validation of the JSP complete without issue? It seems to me that validating the HTML correctly should be no more difficult than validating the HTML in the HTML editor. Am I missing something here?

    Is there some other way to validate JSPs that validate all of the code (HTML, JSP, JSTL, Struts, etc.) contained in a particular page without raising “phantom” issues?

    Thank-you,
    -Rod

    Windows XP Pro/SP2
    Eclipse 3.2.2GA
    MyEclipse 5.1.1GA
    Aptana 0.2.7.13425
    Subversive 1.1.0GA

    #267971 Reply

    Scott Anderson
    Participant

    Rod,

    The HTML validation should work well for JSP pages. What you’re seeing could be caused by a number of configuration or file issues. Can you provide a description and a short example that exhibits one of the problems so we can give that case a specific look and see if we can determine what’s going on?

    #267988 Reply

    Hi Scott,

    Thanks for getting back to me. In putting together an example for you, I have isolated the issue. In order for the HTML to validate properly within the JSP, it must have an HTML doctype. If the doctype is XHTML, the validation will exhibit the issue I related previously: Unknown tag (tagName).

    Save the following as test.jsp and it will compile cleanly with all validations enabled. Then comment out the HTML doctype and uncomment the XHTML doctype and recompile (clean) and you will see the validation errors.

    
    <%--  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    --%>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>JSP Validation Issue Example</title>
    </head>
    
    <body>
    </body>
    </html>
    
    

    I understand that XHTML is not fully supported in the current release (5.1.1) but you may want to check that the validation works correctly for all doctypes. If there is anything I can do to be of more assistance, please let me know.

    Thanks,
    -Rod

    #268210 Reply

    fly_bluewolf
    Member

    I have meet this problem,too.

    
    <?xml version="1.0" encoding="UTF-8" ?>
    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <%@include file="/WEB-INF/pages/common/taglibs.jsp"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <%@ include file="/WEB-INF/pages/common/meta.jsp"%>
            <fmt:setBundle basename="i18n.main" var="main" />
            <title><fmt:message bundle="${main}" key="main.title" /></title>
            <link href="${ctm}/basic.css" type="text/css" rel="stylesheet" />
            <script type="text/javascript" src="${ctx}/scripts/djConfig.js"></script>
            <script type="text/javascript" src="${ctx}/widgets/dojo/dojo.js"></script>
            <script type="text/javascript" language="JavaScript">
                dojo.require("dojo.widget.LayoutContainer");
                dojo.require("dojo.widget.ContentPane");
                dojo.require("dojo.widget.SplitContainer");
                dojo.require("dojo.widget.AccordionContainer");
                dojo.require("dojo.widget.TabContainer");
                dojo.require("dojo.widget.Tree");
                dojo.require("dojo.json");
            </script>
            <script type="text/javascript" src="${ctx}/scripts/prototype.js"></script>
            <script type="text/javascript" src="${ctx}/scripts/ecside.js"></script>
            <script type="text/javascript" src="${ctx}/scripts/main.js"></script>
        </head>
        <body>
            <div dojoType="TreeSelector" eventNames="select:nodeSelected"
                widgetId="treeSelector"></div>
            <div dojoType="LayoutContainer" layoutChildPriority="top-bottom"
                class="layout-container">
                <div id="header" dojoType="ContentPane" layoutAlign="top">
                      top
                </div>
                <div id="footer" dojoType="ContentPane" layoutAlign="bottom"
                    class="barPane">
                    bottom
                </div>
                <div dojoType="SplitContainer" orientation="horizontal"
                    layoutAlign="client" sizerWidth="5">
                    <div dojoType="AccordionContainer"
                        labelNodeClass="accordion_pane_label"
                        containerNodeClass="accordion_pane_body" duration="500"
                        sizeShare="25">
                        <c:forEach var="menu" items="${menus}">
                            <div dojoType="ContentPane" id="${menu.categoryId}"
                                label="<hrp:getDescription var="${menu}"/>">
                                <div dojoType="Tree" class="menu_tree" showGrid="false"
                                    toggle="wipe" toggleDuration="500" selector="treeSelector"
                                    expandIconSrcPlus="${ctm}/images/pkg-closed.gif"
                                    expandIconSrcMinus="${ctm}/images/pkg-open.gif" iconWidth="32"
                                    iconHeight="16">
                                    <hrp:getMenuTree accordionMenu="${menu}" iconSrc="${ctm}/images"
                                        iconHeight="16" iconWidth="16" />
                                </div>
                            </div>
                        </c:forEach>
                    </div>
                    <div dojoType="TabContainer" widgetId="mainTabContainer"
                        sizeShare="75" class="main_tab" selectedChild="homePage">
                        <div widgetId="homePage" dojoType="linkPane"
                            label="<fmt:message bundle="${main}" key="main.homePage"/>"></div>
                    </div>
                </div>
            </div>
        </body>
    </html>
    #268550 Reply

    Hi Scott,

    I was wondering if you had a chance to verify the issue I presented? If so, is this something that will be fixed in the upcoming release or 5.5GA maybe? If not, could you please take a look at the small example I provided and let me know if the issue is legitimate and what, if anything, can be done to work around it.

    Thanks,
    -Rod

    #268572 Reply

    Hi,

    I have the same problem.
    I think this problem appeared when I upgraded from 5.1GA to 5.1.1GA.

    #268868 Reply

    bsavardnok
    Member

    I’ve got MyEclipse 5.1.1GA and have the same problem, and it’s a very basic JSP like this thread’s creator.

    Out of curiosity, I just downloaded the Eclipse 3.2.2/WTP 1.5.3 bundle from eclipse.org and it validates the same JSP without warnings.
    So it would, IMHO, appear to be a MyEclipse bug, since 5.1.1GA is saying that I’ve got Eclipse 3.2.2 and WTP 1.5.3 (same stuff as in the eclipse.org download I just got to validate the JSP).

    Here’s my config:

    *** Date:
    Sunday, April 15, 2007 1:37:14 PM EDT

    ** System properties:
    OS=Windows2000
    OS version=5.0
    Java version=1.5.0_08

    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    Version: 5.1.1 GA
    Build id: 20070302-5.1.1-GA

    *** Eclipse details:
    Eclipse SDK

    Version: 3.2.2
    Build id: M20070212-1330

    Eclipse Platform

    Version: 3.2.2.r322_v20070119-RQghndJN8IM0MsK
    Build id: M20070212-1330

    Eclipse RCP

    Version: 3.2.2.r322_v20070104-8pcviKVqd8J7C1U
    Build id: M20060921-0945

    Eclipse Java Development Tools

    Version: 3.2.2.r322_v20070104-R4CR0Znkvtfjv9-
    Build id: M20060921-0945

    Eclipse Plug-in Development Environment

    Version: 3.2.1.r321_v20060823-6vYLLdQ3Nk8DrFG
    Build id: M20060921-0945

    Eclipse Project SDK

    Version: 3.2.2.r322_v20070104-dCGKm0Ln38lm-8s
    Build id: M20070212-1330

    Eclipse Graphical Editing Framework

    Version: 3.2.2.v20070208
    Build id: 20070208-1315

    #268883 Reply

    Stephan Anft
    Member

    Same problem here after upgrading to 5.1.1. Any news on this?

    Regards,
    Stephan

    #268948 Reply

    I am having the same problem. I am running 5.1.1GA as well.

    #268983 Reply

    Stephan Anft
    Member

    I’ve just found something out. It seems that the problem has something to do with the doctype of the page. If I use the following doctype declaration, the validation fails:

    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;

    However, when I remove the URL the validation runs and finishes without any problem at all:

    <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>

    Regards,
    Stephan

    #268984 Reply

    Stephan Anft
    Member

    Ah … I just saw that this was already mentioned above. Sorry for this…

    #269421 Reply

    Jon Strayer
    Member

    @support-scott wrote:

    Rod,

    The HTML validation should work well for JSP pages. What you’re seeing could be caused by a number of configuration or file issues. Can you provide a description and a short example that exhibits one of the problems so we can give that case a specific look and see if we can determine what’s going on?

    Pardon me for being seriously annoyed, but you have had over a month to look at this without so much as a peep. Is there a bug? Is there a configuration issue? What?

    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    
    <head>
      <title>Test page</title>
    
      <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    </head>
    
    <body>
    The page passes W3C HTML validator with no errors or warnings.<br/>
    But MyEclipse flags 7 errors.  All the tags are unknown.
    </body>
    </html>
    
    #269453 Reply

    Hi jstrayer,

    You may have noticed that I actually did provide an example (as requested) and a description of the bug as isolated in the example only one day after Scott’s request (as you quoted above). I too have requested a follow-up on April 06 (2 weeks after initial contact) and as you pointed out have yet to receive either confirmation of the bug or further feedback regarding same (three more weeks).

    I understand your frustration but I suspect the answer has not come because there simply is no good answer. The issue is related to the lack of adequate XHTML support. If you are following that debacle via other threads, you already know that a resolution is forthcoming, albeit not soon enough. I too am frustrated by this seeming oversight as XHTML has been around for years, it is not a new “buzz” technology. Something as simple (and critical) as validation should have been in the software for some time already; it is an extension of HTML, not something entirely new requiring complete retooling.

    That said, while I would welcome weigh-in by the ME support staff on this topic as well, I believe “annoyance” is a bit harsh. After all, they are in crunch mode on the 5.5 release and have a lot going on. Sometimes forum questions can fall through the cracks and one gets overlooked. It is not intentional. Perhaps raising the issue here again will indeed put it back on someone’s radar. At any rate, the underlying issue is most likely already on their list.

    Thanks for bumping this back into view,
    -Rod

    #269534 Reply

    Riyad Kalla
    Member

    Rod,
    Thank you for the extremely well thought out, understanding message. It’s much appreciated when we are running on coffee grounds here (we don’t even take the time to brew it any more… just eat the grounds)

    jstrayer & others, sorry for leaving the thread void for a while. The status of XHTML is that templates were added in 5.5M2 along with preliminary support in the page designer.

    Then we hit the road again and for our final GA release, just finished wrapping up code assist support for Facelets XHTML pages along with validation.

    So we are banging away at the problem, your feedback after 5.5 ships will help us further refine the support you guys need.

Viewing 14 posts - 1 through 14 (of 14 total)
Reply To: JSP Validation issue…

You must be logged in to post in the forum log in