2016-05-17 100 views
1

我已經定義了註銷流程爲:Spring Web Flow的工作不

<flow xmlns="http://www.springframework.org/schema/webflow" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow.xsd"> 

<view-state id="casLogoutPopup" view="casLogoutApplicationsPopup_new"> 
    <transition on="ok" to="test" /> 
    <transition on="cancel" to="test2" /> 
</view-state> 

<view-state id="test" view="casLogoutView" /> 
<view-state id="test2" view="casLoginView" /> 

這是從瀏覽器訪問註銷時,顯示我的JSP文件「casLogoutApplicationsPopup_new.jsp」。

<form> 
    <input type="hidden" name="execution" value="${flowExecutionKey}" /> 
    <input class="btn_submit" type="submit" name="_eventId_ok" accesskey="o" value="OK" /> 
    <input class="btn_submit" type="submit" style="float: right" name="_eventId_cancel" accesskey="c" value="CANCEL"/> 
</form> 

問題是我不能啓動「測試」網絡流量點擊確定/取消按鈕。

+0

這是一個可能重複的問題。檢查出答案http://stackoverflow.com/questions/11227837/spring-web-flow-transitions-not-triggered –

+0

不,在該流程中,兩個轉換都進入了結束狀態,但在這裏我甚至無法捕獲點擊事件 –

+0

你沒有使用Spring'form:form'和'form:input'標籤? – dbreaux

回答

0

嘗試在action屬性執行網址:

<form action="${flowExecutionUrl}"> 
    <input class="btn_submit" type="submit" name="_eventId_ok" accesskey="o" value="OK" /> 
    <input class="btn_submit" type="submit" style="float: right" name="_eventId_cancel" accesskey="c" value="CANCEL"/> 
</form>