在做spring简单的应用时,报一下异常
javax.servlet.ServletException: successView isn't set
org.springframework.web.servlet.mvc.SimpleFormCont roller.onSubmit(SimpleFormController.java:340)
org.springframework.web.servlet.mvc.SimpleFormCont roller.onSubmit(SimpleFormController.java:307)
org.springframework.web.servlet.mvc.SimpleFormCont roller.processFormSubmission(SimpleFormController. java:248)
org.springframework.web.servlet.mvc.AbstractFormCo ntroller.handleRequestInternal(AbstractFormControl ler.java:243)
org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(AbstractController.java:128)
org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:44)
org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:684)
org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:625)
org.springframework.web.servlet.FrameworkServlet.s erviceWrapper(FrameworkServlet.java:386)
org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:355)
javax.servlet.http.HttpServlet.service(HttpServlet .java:709)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
解决的方法是:
我的onSubmit()方法中的参数,BindException ex应该是org.springframework.validation.BindException,
不应该是jdk中的BindException,方法前面最好加个@override。不加也可以。
javax.servlet.ServletException: successView isn't set
org.springframework.web.servlet.mvc.SimpleFormCont roller.onSubmit(SimpleFormController.java:340)
org.springframework.web.servlet.mvc.SimpleFormCont roller.onSubmit(SimpleFormController.java:307)
org.springframework.web.servlet.mvc.SimpleFormCont roller.processFormSubmission(SimpleFormController. java:248)
org.springframework.web.servlet.mvc.AbstractFormCo ntroller.handleRequestInternal(AbstractFormControl ler.java:243)
org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(AbstractController.java:128)
org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:44)
org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:684)
org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:625)
org.springframework.web.servlet.FrameworkServlet.s erviceWrapper(FrameworkServlet.java:386)
org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:355)
javax.servlet.http.HttpServlet.service(HttpServlet .java:709)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
解决的方法是:
我的onSubmit()方法中的参数,BindException ex应该是org.springframework.validation.BindException,
不应该是jdk中的BindException,方法前面最好加个@override。不加也可以。