Eclipse tomcat - 无法显示index.jsp页面

时间:2016-02-12 09:22:52

标签: java eclipse maven spring-mvc tomcat

我在eclipse中导入了一个maven spring mvc项目。同一个项目在我同事的桌面上成功运行。当我在eclipse中启动tomcat服务器时,我无法看到http://localhost:8080/test/,它显示为错误http状态404。我甚至将端口号更改为8081并再次运行它但是它给出了相同的错误。它无法找到index.jsp页面。

2 个答案:

答案 0 :(得分:0)

尝试使用

File -> Import -> [General] -> Project interchange (for the whole ZIP)

File -> Import -> [General] -> Existing project into workspace (for the extracted file)

让eclipse正确导入它们。

您是否看到tomcat在localhost:8080或8081下正常运行?如果没有,那么这意味着Tomcat通常会出现问题,在tomcat启动尝试期间你可以在catalina.log文件中看到什么(或者在命令shell中你尝试开始' catalina开始'?

答案 1 :(得分:0)

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

上述查询中的第一个答案解决了这个问题。我得到了classNotFoundException,因为我无法查看index.jsp。