java - Forwarding a request in Spring WebFlow -


currently application logic using request parameters execute logic. in new requirement can request have db key(db have values) request parameter. can fetch data database problem existing logic/flow not work expects data in parametermap.

in spring-mvc can forward request again , append parameters request

@controller public class testcontroller {     @requestmapping(value="/test")     public string showtestpage() {         return "forward:/test2?param1=foo&param2=bar";     } }  @controller public class testcontroller2 {     @requestmapping(value="/test2")     public string showtestpage(httpservletrequest request) {         string param1 = request.getparameter("param1");         string param2 = request.getparameter("param2");         return "testpageview";     } } 

but in spring-webflow not sure how replicate same behavior works on states instead of request mapping. can please let me know if there way forward in spring-webflow after adding parameters.

update:

sorry got question wrong.

in webflow have view-states have transitions next state. if want transmit parameters can this:

flow.xml:

<view-state id="test" view="test.jsp>     <transition on="totest2" to="test2" /> </view-state>  <view-state id="test2" view="test2.jsp>     <on-render>         <evaluate expression="test2delegate.dosomething(requestparameters.param2, requestparameters.param2)"      </on-render> </view-state> 

test.jsp:

<a href="${flowexecutionurl}&_eventid=totest2&param1=foo&param2=bar" /> 

java:

@component public class test2delegate {      public void dosomething(string param1, string param2) {          //dosomething     } } 

i recommend read spring web flow reference guide


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -