-1

パスワードを忘れた場合のパスを既存のビューに追加しようとしています。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>

login-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" />
4

1 に答える 1

3

タグ<form:form ... >は正しい Bean を参照する必要があります。あなたの設定には、1つでforgotPasswordBeanはなくforgotPassword1つが記載されています。

フォームオブジェクトが正しい Bean を参照する必要があります

<form:form modelAttribute="forgotPasswordBean" ... >

または、Webflow 構成で Bean の名前を変更する必要があります (それへのすべての参照を含む)。

<var name="forgotPassword" class="com.mycompany.authentication.ForgotPasswordBean" />
于 2013-09-26T18:43:48.243 に答える