File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes path related problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "path related problem" Watch "path related problem" New topic
Author

path related problem

Samith Nambiar
Ranch Hand

Joined: Mar 14, 2001
Posts: 147
hi
<%@ include file="header.html" %>
is it necessary that header.html should be present in the same directory as the jsp file?
i get an error when i use a context relative path
for example :
Context Name : demo
JSP directory : demo/web/jsp
HTML directory : demo/web/html
the following code gives me an error
<%@ include file="/demo/web/html/header.html" %>
why is this so?
thanks
/SAmith
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

That's because the context is relative to the URL, not to the web app path. A Context is part of the URL name, which is mapped to a directory path in the web.xml file.
For the case you've listed, try:
<%@ include file="/web/html/header.hml" %>


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: path related problem