facebook

Having problems with inline code imports.

  1. MyEclipse Archived
  2.  > 
  3. Web Development (HTML, CSS, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #258200 Reply

    Unnsse Khan
    Member

    Hello there,

    I have three files:

    1) index.jsp:

    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
              <%@ include file="header.html" %>
              <div id="bd">
               Welcome to my site!
              <%@ include file="footer.html" %>
              </div>
     </body>
    </html>
    

    2) header.html:

    
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <title>Welcome</title>
    
        <!-- favicon -->
       <link rel="shortcut icon" type="image/x-icon"href="./images/favicon.ico"/>
       
       <!-- Standard reset and fonts -->
       <link rel="stylesheet" type="text/css" href="./stylesheets/body.css">
    
    </head>
    <body id="mycss"> 
    
              <!-- start: your content here -->
               
                   <h1>Welcome.<em>[<a href="index.jsp">Home</a>]</em></h1>
       
               <!-- end: your content here -->
    

    3) footer.html:

    
    <div id="ft">
         <hr>
            <center>
                <table border="0">
                    <tr>
                         <td>
                             <a href="credits.html">Credits</a>
                         </td>
                         <td> | </td>
                         <td>
                             <a href="feedback.html">Feedback</a>
                         </td>
                          <td> | </td>
                         <td>
                             <a href="sitemap.html">Site Map</a>
                         </td>
                    </tr>   
                </table>
                <br>
                     <center> Copyright © 2006 - All Rights Reserved </center> 
            </center>
    </div>
    

    Everything looks good when I deploy this onto Tomcat 5.5.9,
    and test it in a browser, but in the Eclipse IDE’s Problems’ view
    it keeps giving me the following errors:

    No start tag <body>
    No start tag <div>

    for index.jsp, lines 7-8

    As one can see, since the <body> start tag is located in header.html, why does
    the MyEclipse plug-in not notice this from the JSP <%@ import file = “header.html” %>?

    It puts this red error (x) symbol on my index.jsp and even though everything works,
    this error message / symbol is really annoying.

    Will definitely be a deterrent when I use the structure of these 3 files through out the rest of
    my project…

    Can anyone suggest why MyEclipse is viewing this as an error?

    Many, many thanks!

    #258211 Reply

    Riyad Kalla
    Member

    THe problem is the HTML validator (the one spitting out the errors) doesn’t understand includes. I would suggest turning it off for that project. You can turn it off under Project Properties > MyEclipse > Validation.

    #258296 Reply

    Unnsse Khan
    Member

    Riyad,

    Per your suggestion, I did that and index.jsp STILL has the same errors…

    Is it because I need to disable a particular JSP Validator?

    Is my code wrong or is it because MyEclipse doesn’t understand the <%@ include file = “aFile.jsp” %>?

    Many, many thanks!

    #258302 Reply

    Riyad Kalla
    Member

    It depends on what the error is, you may need to clean/rebuild your project or right click on the project, go down to MyEclipse, then “Remove All Validation Markers”.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Having problems with inline code imports.

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