我在Spring中实现HDIV,我在登录页面上遇到了麻烦。因为HDIV需要使用form标记
(比如:<form:form action="${contextPath}/j_spring_security_check" method="post">),我的应用程序会抛出一个异常,因为我没有指定modelAttribute
java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'command' available as request attribute
有人能澄清这个问题吗?是否有其他方法在登录页面上实现HDIV?还是有一种不使用<form:来实现HDIV的方法?
发布于 2015-04-14 14:50:00
正如您在HDIV Spring展示项目中所看到的,您不必在登录页面中使用Spring的表单标记。
此外,您还必须将/j_spring_security_check作为hdiv-config.xml的起始页面。
<hdiv:startPages method="post">/j_spring_security_check</hdiv:startPages>不要担心可编辑的验证,因为它们可以工作,即使url是一个startPage。
https://stackoverflow.com/questions/29621136
复制相似问题