Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SpringWeb流-形式:单选按钮_Spring_Spring Webflow - Fatal编程技术网

SpringWeb流-形式:单选按钮

SpringWeb流-形式:单选按钮,spring,spring-webflow,Spring,Spring Webflow,有人能帮我理解这里出了什么问题吗 这是来自SpringWebFlow项目的片段。我创建了新的对象顺序,并从视图状态的标记中的DB中获取了一个表的列表对象 <?xml version="1.0" encoding="UTF-8"?> <flow xmlns="http://www.springframework.org/schema/webflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

有人能帮我理解这里出了什么问题吗

这是来自SpringWebFlow项目的片段。我创建了新的对象顺序,并从视图状态的标记中的DB中获取了一个表的列表对象

    <?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.xsd">

    <input name="order" required="true" />

    <view-state id="chooseTable" model="flowScope.order">
        <on-entry>
            <set name="flowScope.order" value="new pizza.Order()"></set>
            <evaluate expression="pizzaFlowActions.getFreeTables()"
                result="viewScope.tables" />
        </on-entry>
        <transition on="chosenCreateOrder" to="bookedToOrder">
        <evaluate expression="order.setTable(flowScope.order)" />
        </transition>
        <transition on="chosenNoOrder" to="booked">
        <evaluate expression="order.setTable(flowScope.order)" />
        </transition>
        <transition on="cancel" to="cancel" />
    </view-state>

    <end-state id="cancel" />

    <end-state id="bookedToOrder">
    </end-state>

    <end-state id="booked">
    </end-state>

    <global-transitions>
        <transition on="cancel" to="cancel" />
    </global-transitions>
</flow>

Jsp文件,带有绑定对象顺序的表单,以及从表列表中提取的单选按钮值

<html xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:spring="http://www.springframework.org/tags"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:form="http://www.springframework.org/tags/form">

<jsp:output omit-xml-declaration="yes" />
<jsp:directive.page contentType="text/html;charset=UTF-8" />

<head>
<title>Book a table</title>

</head>
<body background = "${pageContext.request.contextPath}/resources/plan.gif">
    <form:form commandName="order" class="box login">
    <input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}" />        
        <b>Choose table: </b>
        <c:forEach items="${tables}" var="place">   
           <form:radiobutton path="table" label="${place}" value="${place}"/>
        <br></br> 
        <br></br>   
        </c:forEach>
        <input type="submit" class="btnLogin" name="_eventId_chosenCreateOrder" value="Now choose Pizza" />
        <input type="submit" class="btnLogin" name="_eventId_chosenNoOrder" value="Just book a table" />
        <input type="submit" class="btnLogin" name="_eventId_cancel" value="Cancel" />
    </form:form>
</body>
</html>

预定桌子
选择表格:




订单类

public class Order implements Serializable {
private static final Logger LOGGER = getLogger(Order.class);
private int id;
private Customer customer;
private Set<Pizza> pizzas;
private Payment payment;
private Place table;
公共类顺序实现可序列化{
私有静态最终记录器=getLogger(Order.class);
私有int-id;
私人客户;
私人比萨饼;
私人支付;
私人餐桌;
这里的问题是,在任何时候选择任何变体之后,表单只是重新加载,没有更多的事情发生


非常感谢您的帮助和提示。

我建议您发送您试图提交的地点的id,然后查找并按您的顺序进行设置。或者发送该地点的索引,以便您可以在表格列表中找到它并按您的顺序进行设置。真的,这就是我所要做的。所以我猜它起作用了吗?我必须使用简单的html收音机id为表id的元素