标签:
今天在编写代码的时候,自己页面中的按钮都无法点击,CSS样式也无法加载出来,查看之前的Spring MVC 的配置文件也是都正常,查看后台,发现如下错误
严重: Servlet.service() for servlet [springMVC] in context with path [/spring-idap-web] threw exception [Could not resolve view with name ‘javascripts/jquery-2.1.4‘ in servlet with name ‘springMVC‘] with root cause javax.servlet.ServletException: Could not resolve view with name ‘javascripts/jquery-2.1.4‘ in servlet with name ‘springMVC‘ at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1211) at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1011) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:955) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857) at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
后来百度了老半天,什么也没有发现,重新启动MyEclipse,tomcat,甚至机器都重新启动了一遍还是不行。有时候感觉很二啊,感觉出错了重启就好了。。之后逐行比对SVN资源库上的代码,最终终于找到问题的原因
@RequestMapping//问题的原因 public ModelAndView showHomePage() { ModelAndView model = new ModelAndView(); return model; }
其实是在编写Controller的时候,其中的某个方法没有映射到具体的URL地址。所以导致最终出错。解决办法就是为@RequestMapping添加一个URL地址就好了。
标签:
原文地址:http://www.cnblogs.com/rain144576/p/5265307.html