Announcement Announcement Module
Collapse
No announcement yet.
How to check return result of method in spring web flow Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to check return result of method in spring web flow

    public boolean createUser(User user) {
    if (!checkExist(user.getId())) {
    userData.add(user);
    return true;
    }
    return false;
    }
    page-flow.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <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-2.0.xsd">

    <var name="userDAO" class="supportiveLearning.dao.UserDAO"/>
    <input name="id"/>
    <on-start>
    <evaluate expression="userBean" result="flowScope.user" />
    </on-start>

    <view-state id="addUser" model="user">
    <transition on="save" to="newPage">
    <evaluate expression="userDAO.createUser(user)" result="flowScope.user" />
    <set name="flowScope.id" value="user.id" />
    </transition>
    </view-state>

    <view-state id="newPage">
    <transition on="book" to="index" />
    </view-state>

    <subflow-state id="index" subflow="main-flow">

    </subflow-state>

    <end-state id="finish" />

    </flow>
    Thank you very much!
Working...
X