简体   繁体   English

无法访问WEB-INF / folder / folder / file.jsp

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

I'm developing a little servlet with eclipse on a Tomcat server. 我正在Tomcat服务器上用eclipse开发一个小servlet。

From this servlet I want to include some jsp files, it works perfectly for the file 我想从这个servlet包含一些jsp文件,它对于该文件非常有效

WEB-INF/website/NewFile.jsp WEB-INF /网站/NewFile.jsp

But when I try to get a jsp file in 但是当我尝试获取一个jsp文件时

/WEB-INF/website/common / WEB-INF /网站/常见

I get the 404 not found exception. 我得到404 not found异常。
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. 所以我想eclipse在编译它们时在此文件夹中找不到jsp。
I suppose that I have to somehow change the "jsp searching path" of the eclipse project but I don't know how to do 我想我必须以某种方式更改eclipse项目的“ jsp搜索路径”,但我不知道该怎么做

您不能直接访问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. 通常,其他WEB-INF文件夹不可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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