簡體   English   中英

如何在spring webflow中實現Switch / if else if語句?

[英]How to implement Switch/if else if statement in spring webflow?

已實現如下的switch語句。

如果有任何錯誤,請您驗證並更正嗎?

<set name="flowScope.Valid" value="true">
<decision-state id="isDNCheckNotRequired" test="Valid == true">
<transition on="true" to="even"/>
<transition on="false" to="odd"/>
</decision-state>

<action-state id="even">
<evaluate expression="Test.setEven(true)">
</action-state>

<action-state id="odd">
<evaluate expression="Test.set(false)">
</action-state>

請告訴我這是春天webflow 2.0中的實現方式

提前致謝。

引用文檔

對於決策狀態

<decision-state id="moreAnswersNeeded">
    <if test="interview.moreAnswersNeeded()" then="answerQuestions" else="finish" />
</decision-state>

作為替代品

<action-state id="moreAnswersNeeded">
    <evaluate expression="interview.moreAnswersNeeded()" />
    <transition on="yes" to="answerQuestions" />
    <transition on="no" to="finish" />
</action-state>

類似於視圖狀態

<view-state id="uploadFile" model="uploadFileHandler">
    <var name="fileUploadHandler" class="org.springframework.webflow.samples.booking.FileUploadHandler" />
    <transition on="upload" to="finish" >
        <evaluate expression="fileUploadHandler.processFile()"/>
    </transition>
    <transition on="cancel" to="finish" bind="false"/>
</view-state>

請參閱: http//docs.spring.io/spring-webflow/docs/2.3.4.RELEASE/reference/html/actions.html#decision-state

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM