Greetings!
I upgraded to Preview 5 and it seems the old way of doing a redirect in a Java base flow has change. What is the correct way of handling redirects now?
Curtney
Greetings!
I upgraded to Preview 5 and it seems the old way of doing a redirect in a Java base flow has change. What is the correct way of handling redirects now?
Curtney
Curtney Jacobs
How are you doing redirects ATM?
In preview 3, you accomplish a redirect in a java base flow by doing the following:
new RedirectViewDescriptorCreator ("XXXXXXXXX);
In preview 5 the above class is no longer available. I have looked at the API, but I don't see how this can be done now. Also, I don't have access to "*.binding.Expression" API which appears to be what I need now. There is no link to this API.
Curtney
Curtney Jacobs
In PR5 you still have the RedirectViewDescriptorCreator, however it is in the org.springframework.webflow.support package. So basically you could do:
new ViewState(getFlow(), stateId, new RedirectViewDescriptorCreator("/viewName?param0=value0¶m1=value1"), transitions, properties);
Or alternatively:
addViewState(stateId, "redirect:/viewName?param0=value0¶m1=value1", transitions, properties);
The binding library comes in the spring-binding-....jar file which is included in the SWF distribution. Source code is also included.
Erwin
Thanks Erwin,
Curtney
Curtney Jacobs
Erwin, I checked the api again, under support, and it is not there. Also, I checked the pr5 jar and was unable to find the class. Do I have to download a separate jar?
Curtney
Curtney Jacobs
Sorry, my mistake. In PR5 the class is actually a static inner class of the TextToViewDescriptorCreator:
org.springframework.webflow.TextToViewDescriptorCr eator.RedirectViewDescriptorCreator
Check the JavaDoc of TextToViewDescriptorCreator for details: http://static.springframework.org/sp...orCreator.html
"addViewState(stateId, "redirect:/viewName?param0=value0¶m1=value1", transitions, properties);" should still work though...
We've rearranged packages a bit for the next RC1 release to make classes more accessible.
Erwin