[英]Java Web Application Structure Set Welcome Page
I am working on Java after a long period of time so finding it hard to recall the things. 经过很长一段时间,我正在研究Java,因此很难回忆起这些东西。
I configured an web application project in Netbeans like 我在Netbeans中配置了一个Web应用程序项目,例如
WebApplication1
- Web Pages
- META-INF
- WEB-INF
- jsp (folder)
- index.jsp
- login.jsp
- loginsuccess.jsp
- applicationContext.xml (under WEB-INF)
- dispatcher-servlet.xml (under WEB-INF)
- web.xml (under WEB-INF)
- redirect.jsp (under Web Pages)
Now in web.xml under welcome file list is 现在在web.xml中的欢迎文件列表中是
<welcome-file-list>
<welcome-file>redirect.jsp</welcome-file>
</welcome-file-list>
When I try to change redirect.jsp with jsp/login.jsp or login.jso under welcome file list it says 404. 当我尝试在欢迎文件列表下使用jsp / login.jsp或login.jso更改redirect.jsp时,显示为404。
Please suggest me best way to architect and how can I change this behavior if required. 请为我建议最好的架构方法,以及在需要时如何更改此行为。
Thanks 谢谢
您得到404,因为您的jsp folder
位于WEB-INF
并且由于安全原因浏览器无法访问web-inf,请将jsp文件夹保留在root folder
夹下。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.