繁体   English   中英

Spring WebFlow:POST 从流到 MVC Controller

[英]Spring WebFlow: POST from flow to MVC Controller

我有如下 MVC Controller 并将/home映射到该 controller。 要从流重定向到/home ,我在view属性中使用externalRedirect:contextRelative:/home 是否可以在POST中将一些数据传递给/home

MVC Controller

@Controller
public class MainController {

    @RequestMapping(value="/home", method=RequestMethod.POST)
    public String index(@RequestParam String data) {
        return "index";
    }
}

流动

<end-state id="home" view="externalRedirect:contextRelative:/home" />

不。

当您指定externalRedirect: Spring Webflow 将在您的响应中设置重定向代码和 Location header,它只是指示浏览器对指定位置执行 GET 请求。 您可以包含附加到此位置的查询参数,但不能包含 POST 数据。

例如:

<end-state id="home" view="externalRedirect:contextRelative:/home?foo=bar" />

另请注意,您可以根据XSD在此字符串中包含 ${expressions} ,该字符串将针对请求上下文进行评估。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM