使用Spring STS运行示例Spring MVC时出现错误404

时间:2012-03-02 10:15:20

标签: java spring sts-springsourcetoolsuite cloudfoundry

我尝试在Eclipse中使用Spring STS运行示例Spring MVC,但是当我尝试使用我的帐户在CloudFoundry上运行它时,当我访问" Mapped URL"我收到错误404

哪个应该至少显示" Hello World"并显示服务器时间。

我想知道它为什么不运行?我在控制台中看不到任何错误。

编辑:这是完整的console log.

1 个答案:

答案 0 :(得分:1)

您的控制器未被检测到,我认为您忘记配置弹簧以扫描您的应用程序基于注释的控制器:

   <context:component-scan base-package="mypackage.com...."/>
   <context:annotation-config/>

http://renidev.wordpress.com/2009/02/02/how-to-use-springs-context-component-scan-and-annotation/