Spring MVC使用中出现如上异常:
解决方案:注意jsp页面中form中modelAttribute="xxx",xxx为须为ModelName的小写形式,如Model Product在jsp页面中应使用product作为modelAttribute。因为在form提交验证出错后,Model自动的request设置中,将采用如上规范。
javax.servlet.ServletException:Neither BindingResult nor plain target object for bean name 'xxx'available as request attribute 解决方案:注意jsp页面中form中modelAttribute="xxx",xxx为须为ModelName的小写形式,如Model Product在jsp页面中应使用product作为modelAttribute。因为在form提交验证出错后,Model自动的request设置中,将采用如上规范。
本文解决SpringMVC中出现的javax.servlet.ServletException异常问题,详细解释了modelAttribute属性配置错误导致的问题,并提供了解决方案。
1406

被折叠的 条评论
为什么被折叠?



