首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

关于jsp中 include file上的地址有关问题

2013-01-23 
关于jsp中 include file下的地址问题我在jsp文件中有如下一句%@ include file ../test.txt %此jsp文

关于jsp中 include file下的地址问题
我在jsp文件中有如下一句
<%@ include file = "../test.txt" %>
此jsp文件在webcontent下,然后我在此文件的父目录下有test.txt文件,而且在elipse下也没有说有问题,运行后:
type 
Exception report

message 
/NewFile.jsp (line: 11, column: 1) File "../test.txt" not found

description 
The server encountered an internal error that prevented it from fulfilling this request.

exception
org.apache.jasper.JasperException: /NewFile.jsp (line: 11, column: 1) File "../test.txt" not found
为什么会找不到呢?
麻烦大家帮忙解决下。。非常感谢。。 jsp include file
[解决办法]
在jsp文件中引用其他的文件的话,一般用相对路径,用绝对路径会导致无法识别的问题。
楼主看看jsp文件所在的路径和要引用的文件路径,然后进行引用,具体可以问问“谷老师”相对路径的用法。

热点排行