0

如何将新模型传递给 Spring WebFlow2 中的视图状态。我有一个输入屏幕,我的用户在其中输入一些数据,然后返回到服务器进行处理。如果数据正常,那么我必须设置一个工单模型并将其传递给下一个视图状态以显示。

我无法获得下一个视图状态来显示票证中的数据。有人可以帮帮我吗。

我的流量:

<view-state id="MemberInquiry" view="question.jsp" model="memberrequest" >
        <transition on="submit" to="endState">
            <evaluate expression="flowActions.addInquiry(memberrequest)" result="flowScope.ticket"/>
        </transition>

        <transition on="cancel" to="endState" bind="false"/>
    </view-state>

    <view-state id="endState" view="thanks.jsp" >

    </view-state>

这是控制器中的代码:

public Ticket addInquiry(MemberRequest memberrequest) {

        LOGGER.debug("[" + memberrequest.toString() + "]");

        // Setting data over to RT

        String Ticket = memberInquiryService.sentWebRequest(memberrequest);

        /*
         * Setting out the ticket number to be displayed to user
         */

        Map<String, Object> model = new HashMap<String, Object>();
        Ticket t = new Ticket();
        t.setTicketDetails(Ticket);

        LOGGER.debug("[" + t.toString() + "]");

        return t;
    }

这是感谢页面中的代码:

<p>
    Thanks for submitting.  We will get back to you as soon as possible.
    <p>
    <c:out value="${ticket.TicketDetails}" />
    <br>
    </div>
4

1 回答 1

2

尝试一个动作状态:

<transition on="submit" to="addInquiry" />

<action-state id="addInquiry">
    <evaluate expression="flowActions.addInquiry(memberrequest)" result="flowScope.ticket"/>
    <transition to="endState" />
</action-state>
于 2012-09-11T15:51:10.990 回答