Accessing flash attributes in Spring Web flow -


i use,

   redirectattributes.addflashattribute("msg","level complete") 

to access message on redirected jsp.

how can use redirect attribute when redirecting webflow ?

when flash attribute used send data 1 controller webflow have bind redirected flash attribute (from controller) response jsp page of webflow. purpose can maintain backend formaction class bind value scope of webflow. in flow xml can can call custom method on entry of view state.

custom method of formaction class

public void setupreferencedata(requestcontext context) throws exception {         httpservletrequest request = (httpservletrequest) context.getexternalcontext().getnativerequest();         map<string, ?> inputflashmap = requestcontextutils.getinputflashmap(request);         if (inputflashmap != null) {             string flash = (string) inputflashmap.get("flash");             context.getrequestscope().put("flash1", flash);         }     } 

this method call should included in entry section of view state. flow xml should have these portion.

<view-state id="request" view="hello">             <on-entry>                 <evaluate expression="requestaction.setupreferencedata" />             </on-entry>             <transition on="next" to="helloend"/>     </view-state> 

Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -