include directive not working in eclipse

Hello All,

I am using eclipse dynamic web project. I have the main project by the name of JSPEXAMPLE and then i have intro.jsp under web-inf folder for JSPEXAMPLE. i am trying to include a Header.html file. where do i need to save this html file ? i mean in which folder? JSPEXAMPLE? or WEB-INF? i tried to save the sttaic html file in Web-INF and while running my jsp file it gives me an error.

intro.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"

pageEncoding="ISO-8859-1"%>

<%@ page session="false" %>

<%@ page import="java.util.Calendar" %>

<%@ include file="/Header.html" %>

<%

out.println("The time is now " + Calendar.getInstance().getTime());

%>

<%@ include file="Footer.html" %>

Here is the Header.html and Footer.html

<!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=ISO-8859-1">

<title>WellCome</title>

</head>

<body>

Footer.html

</body>

</html>

While runing i get an error that file Header.html is not found but why? i mean i can see it under JSPEXAMPLES/WEB-INF folder

org.apache.jasper.JasperException: /intro.jsp(5,0) File "/Header.html" not found

Can anyone help? Thanks

Message was edited by:

lrngjava

[1839 byte] By [lrngjavaa] at [2007-11-27 9:16:21]
# 1

> <%@ include file="/Header.html" %>

Compare that with this other include line:

> <%@ include file="Footer.html" %>

If Footer.html is being included fine, then do you not see some difference between the path you are specifying for that file versus the other?

warnerjaa at 2007-7-12 22:06:01 > top of Java-index,Java Essentials,New To Java...
# 2
warneja i was just testing my script at that time. sorry /Header.html is "Header.html". i was just trying different ways. not working.
lrngjavaa at 2007-7-12 22:06:01 > top of Java-index,Java Essentials,New To Java...
# 3

I don't know the rules, but in our app we use paths that start with "/WEB-INF" for our includes. ie:

<%@ include file='/WEB-INF/a/b/c/partialpage.jspf' %>

Presumably it looks for files starting from the base directory, not the current directory of your jsp.

Message was edited by:

hunter9000

hunter9000a at 2007-7-12 22:06:01 > top of Java-index,Java Essentials,New To Java...
# 4

> I don't know the rules, but in our app we use paths

> that start with "/WEB-INF" for our includes. ie:

> <%@ include

> file='/WEB-INF/a/b/c/partialpage.jspf' %>

> Presumably it looks for files starting from the base

> directory, not the current directory of your jsp.

>

> Message was edited by:

> hunter9000

thanks for the reply hunter. i tried /WEB-INF/Header.html still gives me error while running on tomcat. i have been searching on google for a while now no success.

lrngjavaa at 2007-7-12 22:06:01 > top of Java-index,Java Essentials,New To Java...
# 5
just frekin great. Stupid of me lol. i had 3 or 4 projects open in eclipse and i am running my jsp file in one project and the other HTML files in other project. Dammit i need some beer . Thanks Alot though Works Fine
lrngjavaa at 2007-7-12 22:06:01 > top of Java-index,Java Essentials,New To Java...