日期:2014-05-17  浏览次数:20804 次

用ajax访问springmvc中方法,为啥返回值出错

@RequestMapping(value = "/change/deleteChangeFile.do", method = RequestMethod.POST)
public void deleteChangeFile(@RequestParam("id") int fileId, Model model) {
if (logger.isInfoEnabled()) {
logger.info("deleteChangeFile(int fileId = " + fileId
+ ", Model model=" + model + ") -  start ");
}

fileService.deleteChangeFile(fileId);
}


这个方法不管加上返回值还是不加上都出错。

ERROR: com.wangyin.change.web.filter.LoginFilter - doFilter(ServletRequest request=org.apache.catalina.connector.RequestFacade@64a871, ServletResponse response=org.apache.catalina.connector.ResponseFacade@6ec21a, FilterChain arg2=org.apache.catalina.core.ApplicationFilterChain@1896444)
javax.servlet.ServletException: Could not resolve view with name 'change/deleteChangeFile' in servlet with name 'appServlet'
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1162)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.wangyin.change.web.filter.LoginFilter.doFilter(LoginFilter.java:77)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
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:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)

------解决方案--------------------
$!   你   !  干嘛