开发者

Spring WebFlow: POST from flow to MVC Controller

开发者 https://www.devze.com 2023-03-08 04:14 出处:网络
I have MVC Controller as below and mapped /home to that controller. To redirect to /home from flow i use externalRedirect:contextRelative:/home in view attribute. Is possible to pass some data to /hom

I have MVC Controller as below and mapped /home to that controller. To redirect to /home from flow i use externalRedirect:contextRelative:/home in view attribute. Is possible to pass some data to /home in POST ?

MVC Controlle开发者_如何学编程r

@Controller
public class MainController {

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

Flow

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


No.

When you are specifying externalRedirect: Spring Webflow is going to set a redirect code and Location header on your response which simply instructs the browser to perform a GET request for the specified location. You can include query parameters appended to this location but not POST data.

For example:

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

Also note that you can include ${expressions} in this string that will be evaluated against the request context, according to the XSD.

0

精彩评论

暂无评论...
验证码 换一张
取 消