0

長いグーグルの後、私は休止状態のサンプルを含むSpring Webフローを見つけることができません.誰もが簡単なSpring Webフローの例で私を助けてくれます.Spring Webフローでログインフォームを作成する必要があります. Spring Web フロー。Hibernate を使用してデータベースに接続するログイン フォームのようなサンプル アプリケーションがあれば役立ちます。

4

3 に答える 3

1

サンプルコードを見つけるのがそれほど難しくない場合、SWFは単なるコントローラーであり、いくつかのプロパティを持つコントローラーとしてSpringMVCに登録されます。

<!-- Creates a flow executor in Spring, responsible for creating and executing flows -->
<flow:flow-executor id="flowExecutor" flow-registry="flowRegistry" />

<!-- Load flow definitions and make them available to the flow executor -->
<flow:flow-registry id="flowRegistry">
    <flow:flow-location id="process-flow" path="/process/flows/process-flow.xml" />
</flow:flow-registry>

<!-- The FlowHandlerMapping helps DispatcherServlet to knowing that it should send flow requests to Spring Web Flow -->
<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping">
    <property name="flowRegistry" ref="flowRegistry" />
</bean>

<!-- The FlowHandlerAdapter is equivalent to a Spring MVC controller in that it handles requests coming in for a flow and processes those requests -->
<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter">
    <property name="flowExecutor" ref="flowExecutor" />
</bean>

取得したら、他のMVCアプリと同じようにHibernateを使用する必要があります。おそらく、SWFがドメインオブジェクト(http://static.springsource.org/spring-webflow/docs/2.3.x/reference/html/ch07s02.html)を管理できるようにするFlowScopedPersistenceContextの使用に興味があるでしょう。

SWFの公式ドキュメント(http://static.springsource.org/spring-webflow/docs/2.3.x/reference/html/index.html)を読むことを検討してください。

于 2012-07-23T12:33:50.053 に答える
0

Hibernate と Spring Web フローを統合することは、難しい作業ではありません。Spring MVC と同じです。Hibernate 構成ファイルを記述するだけです。サービス層を呼び出します。サービス層では、それぞれの DAO を呼び出すだけです。DAO がデータベースと対話する場所。

于 2013-01-03T12:15:51.827 に答える