facebook

JSP Validator erroneously reporting an error

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #264588 Reply

    rroy
    Member

    In MyEclipse 5.1.0 GA, I ran the JSP validator on some files and got an error at the </form> tag line saying that there is no <form> tag when in fact there is. I believe it has something to do with the fact that the form in inside of a table. I have 2 JSP files that use a form inside of a table and they both show the same validation error.

    Here’s a snippet of the JSP file that shows the problem.
    <pre>
    <table id=”attInput” border=0 cellpadding=3 width=100%>
    <tr valign=top>
    <form name=upload target=result method=post enctype=’multipart/form-data’ action=’../servlet/FileAttachmentServlet’>
    <td width=100%><input name=Import value=”” type=file style=”width:360″></td>
    <td><input type=submit onclick=’return(validate(document.all.Import, “A file name”));’ value=”Accept” style=”width:90;”></td>
    </form>
    </tr>
    </table>
    </pre>
    The error appears on the </form> tag saying “No start tag (<form>)”.

    #264595

    Riyad Kalla
    Member

    I cannot reproduce an error, but I can reproduce a warning (because your form is in an invalid location). Try a new JSP file with the contents:

    
    <%@ page language="java" pageEncoding="ISO-8859-1"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
        <body>
            <table id="attInput" border=0 cellpadding=3 width=100%>
                <tr valign=top>
                    <form name=upload target=result method=post
                        enctype='multipart/form-data'
                        action='../servlet/FileAttachmentServlet'>
                    <td width=100%>
                        <input name=Import value="" type=file style="width:360">
                    </td>
                    <td>
                        <input type=submit
                            onclick='return(validate(document.all.Import, "A file name"));'
                            value="Accept" style="width:90;">
                    </td>
                    </form>
                </tr>
            </table>
        </body>
    </html>
    

    Did that work?

    #264601

    rroy
    Member

    No, it did not work for me. I still get the error, no start tag. Here’s my installation details.

    *** Date:
    Monday, January 15, 2007 2:52:55 PM EST

    ** System properties:
    OS=Windows2003
    OS version=5.2
    Java version=1.4.2_13

    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    Version: 5.1.0 GA
    Build id: 20061111-5.1.0-GA

    *** Eclipse details:
    Eclipse SDK

    Version: 3.2.1
    Build id: M20060921-0945

    Eclipse Graphical Editing Framework

    Version: 3.2.1.v20060921
    Build id: 20060921-1617

    Eclipse Platform

    Version: 3.2.1.r321_v20060921-b_XVA-INSQSyMtx
    Build id: M20060921-0945

    Eclipse RCP

    Version: 3.2.1.r321_v20060801-2ekW2BxmcpPUOoq
    Build id: M20060921-0945

    Eclipse Java Development Tools

    Version: 3.2.1.r321_v20060905-R4CM1Znkvre9wC-
    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.1.r321_v20060801-tQ1w49KnTArT0FZ
    Build id: M20060921-0945

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    C:\eclipse\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    4400_54
    -vm
    C:\WINDOWS\system32\javaw.exe

    #264620

    Riyad Kalla
    Member

    Hmm that’s odd.

    Can you try and download our All-In-One installer for 5.1, install it, then run it, creating a new workspace and then try my sample file again?

    #264649

    rroy
    Member

    The same thing happens using the All-In-One installer for 5.1. I created a new Enterprise Application Project with a Web Project Module and then ran validation on the jsp directory which contained a file with your code in it. It gave the same No start tag (<form>) error on the form end tag.

    #264653

    Riyad Kalla
    Member

    Did you make sure to create a new workspace? Something fishy is going on here because I cannot reproduce this on any of our test setups (Windows or Linux) using clean installs. So there is some small difference going on here and I’m trying to narrow down what it is.

    #264655

    rroy
    Member

    I did create a new workspace and used the root directory of the project for it. My previous workspace was under the eclipse directory.

    #264656

    Riyad Kalla
    Member

    Oh, try the default File > New > Project > Web Project, with the default settings (where you have a WebRoot directory) and don’t change anything. Then see if that works. We had a bug where the validator and autocomplete wouldn’t work when the project root was also the webroot and I wonder if that is what is going on.

    #264671

    rroy
    Member

    Using the All-In-One setup, I created a new Web Project using all the defaults, then I created a jsp folder under WebRoot and added the file with your code. JSP validation still gave the error about no start tag.

    #264725

    Riyad Kalla
    Member

    rroy,
    I checked the HTML spec and the validator is right… that is not a valid location. I changed it to this and the error cleared up:

    
    <%@ page language="java" pageEncoding="ISO-8859-1"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
        <body>
            <form name=upload target=result method=post
                enctype='multipart/form-data'
                action='../servlet/FileAttachmentServlet'>
                <table id="attInput" border=0 cellpadding=3 width=100%>
                    <tr valign=top>
                        <td width=100%>
                            <input name=Import value="" type=file style="width:360">
                        </td>
                        <td>
                            <input type=submit
                                onclick='return(validate(document.all.Import, "A file name"));'
                                value="Accept" style="width:90;">
                        </td>
                    </tr>
                </table>
            </form>
        </body>
    </html>
    

    Does thta work for you in your case, or do you need the form tag in that invalid location? Most browsers will allow it, so if you need it, my suggestion would be to mark the file as “Excluded” from validation (right click -> MyEclipse -> Exclude from Validation)

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: JSP Validator erroneously reporting an error

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