 |
|
 |
 |
|
 |
 |
| Author |
Message |
|
|
Post subject: Having problems with inline code imports.
Posted: Sep 07, 2006 - 10:49 AM
|
|
Registered Member


Joined: Jul 10, 2005
Posts: 23
|
|
Hello there,
I have three files:
1) index.jsp:
| Code: |
<!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:
| Code: |
<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:
| Code: |
<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! |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 07, 2006 - 04:04 PM
|
|
Registered Member

Joined: Jan 06, 2004
Posts: 23855
|
|
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. |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 09, 2006 - 09:12 AM
|
|
Registered Member


Joined: Jul 10, 2005
Posts: 23
|
|
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! |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Sep 10, 2006 - 04:53 PM
|
|
Registered Member

Joined: Jan 06, 2004
Posts: 23855
|
|
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". |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
| |
|
|
 |
|
 |
|
|
|
 |