运行javaweb项目时显示404-解决办法
·
运行javaweb项目时显示404
原因:未设置默认首页(如果有jsp文件)

在WEB-INF文件夹中新建web.xml文件,加入以下代码
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>book-demo</display-name>
<welcome-file-list>
<welcome-file>zhuce.jsp</welcome-file>
</welcome-file-list>
</web-app>
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)