Search code examples
javaspringspring-webflow

What does the "value" attribute in <set> element of spring web flow contain?


I am a beginner to Spring Web Flow. I came across this tag in flow xml files. One such example is

<on-start>
    <set name="flowScope.products" value="cartService.products"/>
    <set name="flowScope.shippingOptions"value="cartService.shippingOptions"/>
    <set name="requestScope.productId" value="requestParameters.productId"/>
</on-start>

What does the value - cartService.shippingOptions mean? Is it referring any java field? or is it just a string? what does value = "requestParameters.productId" refer to ? On the whole, what are the possible values for a <set> tag? I referred the documents, but not clear. Can anyone please help whether the value attribute of <set> tag contains a string or is it reference to a java field?

Please find the link for the whole code https://github.com/DanielMichalski/spring-web-flow/blob/master/src/main/webapp/WEB-INF/flows/checkout.xml

Can anyone please answer this?


Solution

  • requestParameters is a special EL variable referring to the parameters in the http request. see special variables

    value is more generally an EL expression that can be evaluated. you can use any spring beans, inputs, variables, scopes, event etc.

    see this link for more details about EL