0

注文は PaymentController で生成され、ThankyouController に送信されます

@Results({
    @Result(name="create",  type="redirectAction", 
            params = {"actionName" , "thankyou", "order", "${order}"})
})
public class PaymentController {
    private Order order;

    public Order getOrder()
        return order;

    public void setOrder(Order order)
        this.order = order;

    public String create()
        order = generateOrder();
        return "create";
}



public class ThankyouController
    private Order order;

    public HttpHeaders index()
    {
        System.out.println("---------------------" + order + "-----------------------------");
        return new DefaultHttpHeaders("index").withStatus(200);
    }

    public Order getOrder()
        return order;

    public void setOrder(Order order)
        this.order = order;

しかし、いくつかの理由で、ThankyouController で Null 値を取得し続けます。

session を使用せずにアクション間で値を渡す正しい方法を誰かに教えてもらえますか?

4

0 に答える 0