facebook

Problems parsing/validating JSP page [Closed]

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

    Hi,

    The JSP code below produces validation errors against the

    <tr>

    elments. The error is

    invalid location for tag tr

    . In my actual code I get bogus errors against the

    <p/>

    tag that indicates

    No start tag <p>

    when there is.

    I also do not get previewer output, but I suppose that is to be expected.

    I this something I am doing wrong or is it a MyEclipse problem?

    Thanks,
    Joel

    
    <jsp:root
      version="2.0" 
      xmlns:jsp="http://java.sun.com/jsp_2_0" >
    
    <jsp:directive.page language="java" />
    <jsp:directive.page contentType="text/html" />
    
    <html>
      <head>
        <title>My Title</title>
      </head>
    
      <body>
            <table border="0" width="90%">
              <tr>
                <td width="50%"><p>Stimulus</p></td>
                <td width="50%"><p>Action/Response</p></td>
              </tr>
    
              <tr valign="top">
                <td width="50%"><p>This is text</p></td>
                <td width="50%">
                  <table border="0">
                    <tr valign="top">
                      <td width="50%"><p>More text</p></td>
                    </tr>
                  </table>  
      </body>
    </html>
    </jsp:root>
    
    #212659 Reply

    Riyad Kalla
    Member

    Joel,
    This was actually brought up in another thread, according to HTML spec <tr> tags are suppose to occur only within <tbody> tags… but we know that no one uses tbody tags so we are looking at relaxing this.

    Also you might have some trouble disabling HTML validation to work around this as there are some known bugs (soon to be fixed) with validation.

    #212704 Reply

    Riyad,

    Thanks for the reply. I do understand that there are JSP problems that you folks are addressing. Is there any reason I am getting the errors against the <p> tag in my page. That page is has a lot of dependencies so I do not think it would be useful for me to send it to you. If this is also a know problem I then no problem, otherwise I will have to try to come up with a simply test case for you.

    I have also put the <tbody> in place. The errors all disappear, but the page still does not preview. Any ideas?

    Cheers,
    Joel

    
    <jsp:root version="2.0" xmlns:jsp="http://java.sun.com/jsp_2_0">
        <jsp:directive.page language="java" />
        <jsp:directive.page contentType="text/html" />
    
        <html>
        <head>
        <title>My Title</title>
        </head>
    
        <body>
    
        <table border="0" width="90%">
            <TBODY>
                <tr>
                    <td width="50%">
                    <p>Stimulus</p>
                    </td>
                    <td width="50%">
                    <p>Action/Response</p>
                    </td>
                </tr>
    
                <tr valign="top">
                    <td width="50%">
                    <p>This is text</p>
                    </td>
    
                    <td width="50%">
                <tr valign="top">
                    <td width="50%">
                    <p>More text</p>
                    </td>
                </tr>
            </TBODY>
        </table>
    
        </body>
        </html>
    </jsp:root>
    
    
    #212721 Reply

    Riyad Kalla
    Member

    Joel,
    We fixed the preview problem internally last night (it was an issue with translation in certain cases that we weren’t working around), however I’m not sure about the </p> problem… I just tried your sample above and actually got an invalid action error on the jsp: Root element… I will PR this right now and see what we can find. Thank you for the sample!

    #212777 Reply

    Riyad Kalla
    Member

    Joel,
    I checked with the dev and he had this to say about the page:

    The problem with this page is that the namespace used is not correct for the
    latest versions packaged in the 1.4 library set’s jsp-api.jar file. The first
    line should read:
    <jsp:root version=”2.0″ xmlns:jsp=”http://java.sun.com/JSP/Page”&gt;
    to validate properly. This is a user config problem as once the change is made,
    it validates properly. Of course, the other option is to specify an alternative
    jar the actually defines whatever that URI really is. Changing it to be correct
    is easier, though.

    So maybe give that a try and see if it works.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Problems parsing/validating JSP page [Closed]

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