简体   繁体   中英

Spring WebFlow: POST from flow to MVC Controller

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 Controller

@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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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