gao634209276
2016-04-13 10:15
启动时候冒出来启动信息才多呢..这个是启动完成后,浏览器打开网页产生的....
[INFO] Started ServerConnector@27755487{HTTP/1.1}{0.0.0.0:8080} [INFO] Started @4873ms [INFO] Started Jetty Server 92980 [qtp403960809-18] DEBUG org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'mvc-disp atcher' processing GET request for [/] 92980 [qtp403960809-18] DEBUG org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'mvc-disp atcher' processing GET request for [/] 92980 [qtp403960809-18] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Look ing up handler method for path / 92980 [qtp403960809-18] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Look ing up handler method for path / 92990 [qtp403960809-18] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Did not find handler method for [/] 92990 [qtp403960809-18] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Did not find handler method for [/] 92990 [qtp403960809-18] WARN org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/] in DispatcherServlet with name 'mvc-dispatcher' 92990 [qtp403960809-18] WARN org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/] in DispatcherServlet with name 'mvc-dispatcher' 92990 [qtp403960809-18] DEBUG org.springframework.web.servlet.DispatcherServlet - Successfully completed request 92990 [qtp403960809-18] DEBUG org.springframework.web.servlet.DispatcherServlet - Successfully completed request 93062 [qtp403960809-23] DEBUG org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'mvc-disp atcher' processing GET request for [/favicon.ico] 93062 [qtp403960809-23] DEBUG org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'mvc-disp atcher' processing GET request for [/favicon.ico] 93062 [qtp403960809-23] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Look ing up handler method for path /favicon.ico 93062 [qtp403960809-23] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Look ing up handler method for path /favicon.ico 93062 [qtp403960809-23] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Did not find handler method for [/favicon.ico] 93062 [qtp403960809-23] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Did not find handler method for [/favicon.ico] 93062 [qtp403960809-23] WARN org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/favicon.ico] in DispatcherServlet with name 'mvc-dispatcher' 93062 [qtp403960809-23] WARN org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/favicon.ico] in DispatcherServlet with name 'mvc-dispatcher' 93062 [qtp403960809-23] DEBUG org.springframework.web.servlet.DispatcherServlet - Successfully completed request 93062 [qtp403960809-23] DEBUG org.springframework.web.servlet.DispatcherServlet - Successfully completed request 93062 [qtp403960809-23] DEBUG org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'mvc-disp atcher' processing GET request for [/favicon.ico] 93062 [qtp403960809-23] DEBUG org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'mvc-disp atcher' processing GET request for [/favicon.ico] 93062 [qtp403960809-23] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Look 118063 [qtp403960809-18] DEBUG org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapping [/resources/im gs/course-img.jpg] to HandlerExecutionChain with handler [ResourceHttpRequestHandler [locations=[ServletContext resource [/resources/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@76332405]]] and 1 interceptor 118063 [qtp403960809-18] DEBUG org.springframework.web.servlet.DispatcherServlet - Last-Modified value for [/resources/ imgs/course-img.jpg] is: -1 118063 [qtp403960809-18] DEBUG org.springframework.web.servlet.DispatcherServlet - Last-Modified value for [/resources/ imgs/course-img.jpg] is: -1 118073 [qtp403960809-23] DEBUG org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'mvc-dis patcher' processing GET request for [/resources/img/course_info_sprit.png] 118073 [qtp403960809-23] DEBUG org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'mvc-dis patcher' processing GET request for [/resources/img/course_info_sprit.png] 118073 [qtp403960809-23] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Loo king up handler method for path /resources/img/course_info_sprit.png 118073 [qtp403960809-23] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Loo king up handler method for path /resources/img/course_info_sprit.png 118073 [qtp403960809-23] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Did not find handler method for [/resources/img/course_info_sprit.png] 118073 [qtp403960809-23] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Did not find handler method for [/resources/img/course_info_sprit.png] 118073 [qtp403960809-23] DEBUG org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Matching patterns for request [/resources/img/course_info_sprit.png] are [/resources/**] 118073 [qtp403960809-23] DEBUG org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Matching patterns for request [/resources/img/course_info_sprit.png] are [/resources/**] 118073 [qtp403960809-23] DEBUG org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - URI Template variables for request [/resources/img/course_info_sprit.png] are {} 118073 [qtp403960809-23] DEBUG org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - URI Template variables for request [/resources/img/course_info_sprit.png] are {} 118073 [qtp403960809-23] DEBUG org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapping [/resources/im g/course_info_sprit.png] to HandlerExecutionChain with handler [ResourceHttpRequestHandler [locations=[ServletContext re source [/resources/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@76332405]]] and 1 interc eptor 118073 [qtp403960809-23] DEBUG org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapping [/resources/im g/course_info_sprit.png] to HandlerExecutionChain with handler [ResourceHttpRequestHandler [locations=[ServletContext re source [/resources/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@76332405]]] and 1 interc eptor 118073 [qtp403960809-23] DEBUG org.springframework.web.servlet.DispatcherServlet - Last-Modified value for [/resources/ img/course_info_sprit.png] is: -1 118073 [qtp403960809-23] DEBUG org.springframework.web.servlet.DispatcherServlet - Last-Modified value for [/resources/ img/course_info_sprit.png] is: -1 118073 [qtp403960809-23] DEBUG org.springframework.web.servlet.DispatcherServlet - Null ModelAndView returned to Dispat cherServlet with name 'mvc-dispatcher': assuming HandlerAdapter completed request handling 118073 [qtp403960809-23] DEBUG org.springframework.web.servlet.DispatcherServlet - Null ModelAndView returned to Dispat cherServlet with name 'mvc-dispatcher': assuming HandlerAdapter completed request handling 118073 [qtp403960809-23] DEBUG org.springframework.web.servlet.DispatcherServlet - Successfully completed request 118073 [qtp403960809-23] DEBUG org.springframework.web.servlet.DispatcherServlet - Successfully completed request 118083 [qtp403960809-18] DEBUG org.springframework.web.servlet.DispatcherServlet - Null ModelAndView returned to Dispat cherServlet with name 'mvc-dispatcher': assuming HandlerAdapter completed request handling 118083 [qtp403960809-18] DEBUG org.springframework.web.servlet.DispatcherServlet - Null ModelAndView returned to Dispat cherServlet with name 'mvc-dispatcher': assuming HandlerAdapter completed request handling 118083 [qtp403960809-18] DEBUG org.springframework.web.servlet.DispatcherServlet - Successfully completed request 118083 [qtp403960809-18] DEBUG org.springframework.web.servlet.DispatcherServlet - Successfully completed request 120885 [qtp403960809-16] DEBUG org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'mvc-dis patcher' processing GET request for [/resources/img/course_info_sprit.png] 120885 [qtp403960809-16] DEBUG org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'mvc-dis patcher' processing GET request for [/resources/img/course_info_sprit.png] 120885 [qtp403960809-16] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Loo king up handler method for path /resources/img/course_info_sprit.png 120885 [qtp403960809-16] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Loo king up handler method for path /resources/img/course_info_sprit.png 120885 [qtp403960809-16] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Did not find handler method for [/resources/img/course_info_sprit.png] 120885 [qtp403960809-16] DEBUG org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Did not find handler method for [/resources/img/course_info_sprit.png] 120885 [qtp403960809-16] DEBUG org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Matching patterns for request [/resources/img/course_info_sprit.png] are [/resources/**] 120885 [qtp403960809-16] DEBUG org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Matching patterns for request [/resources/img/course_info_sprit.png] are [/resources/**] 120895 [qtp403960809-16] DEBUG org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - URI Template variables for request [/resources/img/course_info_sprit.png] are {} 120895 [qtp403960809-16] DEBUG org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - URI Template variables for request [/resources/img/course_info_sprit.png] are {} 120895 [qtp403960809-16] DEBUG org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapping [/resources/im g/course_info_sprit.png] to HandlerExecutionChain with handler [ResourceHttpRequestHandler [locations=[ServletContext re source [/resources/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@76332405]]] and 1 interc eptor 120895 [qtp403960809-16] DEBUG org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapping [/resources/im g/course_info_sprit.png] to HandlerExecutionChain with handler [ResourceHttpRequestHandler [locations=[ServletContext re source [/resources/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@76332405]]] and 1 interc eptor 120895 [qtp403960809-16] DEBUG org.springframework.web.servlet.DispatcherServlet - Last-Modified value for [/resources/ img/course_info_sprit.png] is: -1 120895 [qtp403960809-16] DEBUG org.springframework.web.servlet.DispatcherServlet - Last-Modified value for [/resources/ img/course_info_sprit.png] is: -1 120895 [qtp403960809-16] DEBUG org.springframework.web.servlet.DispatcherServlet - Null ModelAndView returned to Dispat cherServlet with name 'mvc-dispatcher': assuming HandlerAdapter completed request handling 120895 [qtp403960809-16] DEBUG org.springframework.web.servlet.DispatcherServlet - Null ModelAndView returned to Dispat cherServlet with name 'mvc-dispatcher': assuming HandlerAdapter completed request handling 120895 [qtp403960809-16] DEBUG org.springframework.web.servlet.DispatcherServlet - Successfully completed request 120895 [qtp403960809-16] DEBUG org.springframework.web.servlet.DispatcherServlet - Successfully completed request
把倒数第二行注释掉就没事了
log4j.appender.Cons=org.apache.log4j.ConsoleAppender log4j.appender.Cons.layout=org.apache.log4j.PatternLayout log4j.appender.Cons.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n # Root logger set to DEBUG using the A2 appender defined above. log4j.rootLogger=info, Cons log4j.additivity=false #Application Logger+ log4j.logger.com.imooc.mvcdemo=debug, Cons #log4j.logger.org.springframework=debug, Cons log4j.additivity.com=false
只用注释倒数第二行就行了,这行代表org.springframework这个包下面的所有debug信息都输出,所以注释了,值保留log4j.logger.com.imooc.mvcdemo=debug, Cons,就OK了
知道是哪里的问题了,但是不知道具体原因是为什么.老师的就没这么多debug信息,
是log4j的properties配置问题,我把最后的debug配置注销掉,同时把controller类中的log4j日志输出改为info...结果就没事了...
log4j.appender.Cons=org.apache.log4j.ConsoleAppender log4j.appender.Cons.layout=org.apache.log4j.PatternLayout log4j.appender.Cons.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n # Root logger set to DEBUG using the A2 appender defined above. log4j.rootLogger=info, Cons log4j.additivity=false #log4j.logger.com.imooc.mvcdemo=debug, Cons #log4j.logger.org.springframework=debug, Cons #log4j.additivity.com=false
public String viewCourse(@RequestParam("courseId") Integer courseId, Model model) { //通过日志观察 log.info("In viewCourse, courseId = {}", courseId); //log.debug("In viewCourse, courseId = {}", courseId); Course course = courseService.getCoursebyId(courseId); model.addAttribute(course); return "course_overview";
求原因
Spring MVC起步
195972 学习 · 572 问题
相似问题