jsp:include doesn't allow absolute path?
1 posts in topic
Flat View  Flat View

Posted By:   Adele_Zhou
Posted On:   Monday, October 17, 2005 11:23 PM

Hi, I'm a jsp newbie.
I tried

But the page shows Error 404: File not found: null

If I use
and put testList.html in the same dir as the jsp page, everything is fine.

Does disallow absolute path? If so, how can I solve this problem?

Thank you very much.

Re: jsp:include doesn't allow absolute path?

Posted By:   Anonymous  
Posted On:   Saturday, October 22, 2005 11:08 AM

jsp:include allows inclusion of contents from dynamic resources or static resources resides within the boundary of the web application. In other words, it will not allow you to cross over to other web application or to somewhere else in your underlying file system to obtain your file like what you trying to do.

jsp:include do allow absolute path, "absolute" in the sense of relative to the web application , example like "/files/yourfile.txt".

To solve your problem, it is either you move your files to be included to your application (and if you want to protect the file from public access, you can put it under /WEB-INF), or you can create FileInputStream to read in the file.
About | Sitemap | Contact