简体   繁体   中英

Can't access to WEB-INF/folder/folder/file.jsp

I'm developing a little servlet with eclipse on a Tomcat server.

From this servlet I want to include some jsp files, it works perfectly for the file

WEB-INF/website/NewFile.jsp

But when I try to get a jsp file in

/WEB-INF/website/common

I get the 404 not found exception.
I've some other files in the "common" folder and I can get access to them.
So I guess that eclipse doesn't find the jsp in this folder when it comes to compile them.
I suppose that I have to somehow change the "jsp searching path" of the eclipse project but I don't know how to do

您不能直接访问WEB-INF文件夹下的文件。容器将在WEB-INF / classes中查找类,而WEB-INF下的jsp文件可以被其他JSP / servlet包含,但是任何请求资源的浏览器都会收到404响应

Try

/yourapp/WEB-INF/classes/META-INF/resources/website/common/newfile.jsp

for

http://localhost:8080/yourapp/website/common/newfile.jsp

Often other WEB-INF folders are not available.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM