我正在将我的一个应用程序从 Spring 工具套装 IDE 移植到纯 Eclipse Java EE IDE。在这个过程中,我正在重命名一些包并更改为基于 Maven。然后所有的控制器都不再工作了。
我认为注释控制器发现似乎坏了。没有使用 Spring 注册映射 url。
有谁知道问题是什么?
我从我的 STS(工作)中收集旧日志,它可以工作并且喜欢
> 2013-04-21 22:43:05,622 [Thread-1] DEBUG
> org.springframework.beans.factory.support.DefaultListableBeanFactory -
> Finished creating instance of bean
> 'org.springframework.web.servlet.handler.MappedInterceptor#2'
> 2013-04-21 22:43:05,623 [Thread-1] DEBUG
> org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
> - Looking for request mappings in application context: WebApplicationContext for namespace 'HelloSpringroo2-servlet': startup
> date [Sun Apr 21 22:43:05 EDT 2013]; parent: Root
> WebApplicationContext 2013-04-21 22:43:05,653 [Thread-1] INFO
> org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
> - Mapped "{[/account/create],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}"
> onto public java.lang.String
> com.hellospringroo.controllers.AccountController.createAccountActionDisplay(org.springframework.ui.Model)
> 2013-04-21 22:43:05,653 [Thread-1] INFO
> org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
> - Mapped "{[/account/view/{account_Id}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}"
> onto public java.lang.String
> com.hellospringroo.controllers.AccountController.viewAccountActionDisplay(int,org.springframework.ui.Model)
> throws java.lang.Exception
然后我从 Eclipse 收集日志(问题一)
> 2013-04-21 22:48:04,900 [http-bio-8080-exec-3] DEBUG
> org.springframework.web.servlet.DispatcherServlet - DispatcherServlet
> with name 'Education' processing GET request for [/Education/]
> 2013-04-21 22:48:04,901 [http-bio-8080-exec-3] DEBUG
> org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
> - Looking up handler method for path / 2013-04-21 22:48:04,901 [http-bio-8080-exec-3] DEBUG
> org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
> - Did not find handler method for [/] 2013-04-21 22:48:04,904 [http-bio-8080-exec-3] DEBUG
> org.springframework.web.servlet.handler.SimpleUrlHandlerMapping -
> Mapping [/] to HandlerExecutionChain with handler
> [org.springframework.web.servlet.mvc.ParameterizableViewController@54bbb2d0]
> and 1 interceptor 2013-04-21 22:48:04,905 [http-bio-8080-exec-3] DEBUG
> org.springframework.web.servlet.DispatcherServlet - Last-Modified
> value for [/Education/] is: -1 2013-04-21 22:48:04,914
> [http-bio-8080-exec-3] DEBUG
> org.springframework.beans.factory.support.DefaultListableBeanFactory -
> Invoking afterPropertiesSet() on bean with name 'index'