java apache tomcat 没有检测到 jsp 文件,即使它存在
我遇到一个奇怪的问题,apache tomcat 服务器显示 404 服务器代码。但系统正在检测某些文件。我正在使用 eclipse 进行开发。
有什么建议吗?
编辑1:
我已经检查了CATALINA_HOME的webapps文件夹,但没有任何与该项目相关的内容。
I have come across to a strange problem where apache tomcat server is showing 404 server code. But some of the files are being detected by the system. I am using eclipse for the development.
Any suggestions?!
EDIT 1 :
i have checked the webapps folder of CATALINA_HOME but nothing is there related to the project.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我建议您看看是否可以在不使用 Eclipse 的情况下在 Tomcat 中成功部署 WAR 文件。
现在看来您不太了解 Java Web 应用程序或 Tomcat。
当你把 Eclipse 放在它上面时,就会有太多的无知而无法取得进展。
所以删除一件你不理解的东西。看看是否可以制作 WAR 文件,手动部署它,然后在浏览器中手动查看您的 JSP。一旦成功,您就有了一个比较 Eclipse 需要如何做事情的基线。
I'd recommending seeing if you can deploy a WAR file successfully in Tomcat without using Eclipse.
Right now it sounds like you don't understand Java web apps or Tomcat very well.
When you throw Eclipse on top of it there's too much ignorance to make progress.
So remove one of the things you don't understand. See if you can make the WAR file, deploy it manually, and see your JSP in the browser by hand. Once that works, you have a baseline for comparing how Eclipse needs to do things.
另一个可能导致类似问题的问题是,如果您已将应用程序部署在根上下文中(即在名称 ROOT 下),并且有问题的 jsp 位于 /manager 之类的文件夹中,而您还有管理器应用程序。在这种情况下,Tomcat 将优先考虑管理器应用程序,而不是 ROOT 应用程序内的 /manager 路径
Another possible issue that might cause similar problems is if you have deployed your application in the root context (i.e. under the name ROOT) and the jsp in question is in a folder like /manager, while you also have the manager application. In this case, Tomcat will give preference to the manager application, rather than the /manager path inside the ROOT application
Eclipse 不会总是动态部署(也称为热部署),您需要重新部署它。因此,确定的检查方法是实际进入 war 文件或根目录并检查 jsp 是否存在。
此外,您还必须提供有关它是什么样的网络应用程序的大量信息,以便我更好地理解问题。例如,在 struts 中,struts-config.xml 中的错误条目将导致 404,即使预期的 jsp 存在。
Eclipse wont always deploy dynamically aka hot deploy and you need to make it re-deploy. So sure shot way of checking is to actually going into the war file, or the root directory and checking if the jsp exists.
Also you have to provided much information as to what kind of a web application it is, for me to understand the problem better. For example, in struts a wrong entry in struts-config.xml will result in 404 even if the intended jsp is present.