Very much stuck in a framework switching process.

My team is in process of converting a Spring Webflow prject into Spring MVC framework inorder to support a new ui framework.

Since we have only very little time and the codebase is huge,we thought of reusing the java code. Now we face the below issue.

Let us think that i have an object "ABC" with 10 attributes maintained in FlowScope in webflow.Since it was webflow, we had no overhead of form binding.

If we switch to MVC, if the form collects only 5 attributes of the object, in controller how can i get all the 10 attibutes of the object.

Thought of a process like binding the values by keeping a copy of the object initially in session and later setting modal attributes on form submission. But this approach fails when i need to handle lists. When we need to bind indexed position in list.

So i want to know if there is any mechanism to include WebFlow feature in MVC. Like setting Session Object in place of Modal Object, so that I can get an updated object in my controller with all attibutes. Is this possible?? Kindly give some suggestion.

有帮助吗?

解决方案

at last I got solution for the above issue.

Annotate class that wants to be in session with @SessionAttribute, then you can access the updated modal with all attributes combined in both session and model by using @ModelAttribute param in the controller.

Thanks to my friend sharing this solution.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top