2013-09-26 1 views
0

기존보기에 암호 분실 경로를 추가하려고합니다. 웹 플로우에서 새로운 뷰, 액션, 모델 빈 및 일부 주를 만들었습니다. 보기를 보는 대신 오류가 계속 발생합니다 (java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'forgotPassword' available as request attribute). 나는 콩이 존재한다는 것을 안다. I 생각해 보면 웹 플로우를 올바르게 설정했지만 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" /> 
+0

'forgotPasswordBean'은'forgotPassword'가 아닙니다. 그러므로'

'태그를'forgotPasswordBean'을 참조하도록 변경하거나 이름을'forgotPassword'로 변경하십시오. –

+0

@ M.Deinum 이 될까요? –

+1

'modelAttribute' 또는'commandName' 중 하나가 작동합니다. –

답변

3

귀하의 <form:form ... > 태그가 올바른 빈을 참조해야합니다. 구성에 forgotPasswordBean이 포함되어 있고 forgotPassword이 아닙니다.

어느 올바른 콩

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

아니면 (그것에 모든 참조 포함) webflow 구성에서 콩의 이름을 변경해야을 참조해야 폼 객체입니다.

<var name="forgotPassword" class="com.mycompany.authentication.ForgotPasswordBean" />