我正在尝试将忘记密码路径添加到现有视图。我在我的 webflow 中创建了一个新的视图、动作、模型 bean 和一些状态。我没有看到视图,而是不断收到错误消息java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'forgotPassword' available as request attribute
。我知道 bean 存在,它应该是可见的。我想我正确设置了 webflow,但我不是 100% 确定。有人知道我可能做错了什么吗?
casLoginView.jsp:
<a href="/cas/login?execution=${flowExecutionKey}&_eventId=forgotPassword">Forgot Password</a>
登录-webflow.xml:
<var name="credentials" class="org.jasig.cas.authentication.principal.UsernamePasswordCredentials" />
<var name="forgotPasswordBean" class="com.mycompany.authentication.ForgotPasswordBean" />
<view-state id="viewLoginForm" view="casLoginView" model="credentials">
<binder>
<binding property="username" />
<binding property="password" />
</binder>
<on-entry>
<set name="viewScope.commandName" value="'credentials'" />
</on-entry>
<transition on="submit" bind="true" validate="true" to="realSubmit">
<evaluate expression="authenticationViaFormAction.doBind(flowRequestContext, flowScope.credentials)" />
</transition>
<transition on="forgotPassword" bind="false" validate="false" to="forgotPasswordView"/>
</view-state>
<view-state id="forgotPasswordView" view="myForgotPasswordView.jsp" model="forgotPasswordBean">
<binder>
<binding property="username" required="true"/>
</binder>
<transition on="submit" to="forgotPassword"/>
</view-state>
<action-state id="forgotPassword">
<evaluate expression="forgotPasswordAction.submit(flowScope.forgotPasswordBean)" />
<transition on="success" to="newPasswordSentView"/>
<transition on="forbidden" to="forgotPasswordForbiddenView"/>
<transition on="error" to="forgotPasswordView"/>
</action-state>
<end-state id="newPasswordSentView" view="myNewPasswordSentView" />
<end-state id="forgotPasswordForbiddenView" view="forgotPasswordForbiddenView" />