[英]Spring Webflow: How to pass a bean from a controller to a flow? (using input mapping)
[英]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.