无法访问WEB-INF/JSP文件夹 [英] Not able to acces WEB-INF/JSP folder

查看:112
本文介绍了无法访问WEB-INF/JSP文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在WEB-INF&中创建了一个名为jsp的文件夹.将所有.jsp文件放入此文件夹.我更改了web.xml

I created a folder named jsp in WEB-INF & putting all the .jsp files in this folder. I changed the web.xml

正在提供 HTTP Status 404/JasperPjt/jsp/Login.jsp找不到.

请帮帮我.

推荐答案

将JSP文件放入WEB-INF目录的主要目的是只能从服务器(而不是客户端)访问JSP文件.能够知道文件的确切网址.

The main purpose of putting JSP files in WEB-INF directory is that it will be accessible from the server only, not from client end.(Client will not be able to know the exact URL of file).

如果您尝试调用该文件(WEB-INF中的文件),则服务器将返回HTTP 404.

If you try to call that file(Files in WEB-INF), server will return HTTP 404.

只需调用servlet,然后您就可以像这样调用该JSP文件:

Just call servlet and then you can call that JSP file like :

request.getRequestDispatcher("/WEB-INF/TargetJspFile.jsp").forward(request, response);

这篇关于无法访问WEB-INF/JSP文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆