首页 > 技术文章 > eclipse新建的项目,也添加到tomcat上了,地址栏访问的时候就是访问不到。。。怎么办

liuyongbo 2018-03-28 23:39 原文

其实是可以访问的,目前我遇到以下两种可能出现这种现象的原因:

1.这个项目在你写的过程中改了名字,这样你访问改后的名字是不行的,需要在下图,也就是server服务器的server.xml文件中修改访问路径为你对应的项目名才能访问到。

2.没有配置默认项目的访问页面,或者现在想访问的项目中没有设置的默认页面中的任何一个。

需要在web.xml中设置

<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>login.jsp</welcome-file>
<welcome-file>home.jsp</welcome-file>

</welcome-file-list>

 

推荐阅读