I am new to SpringMVC using annotations. Learning the flow, but stuck with a situation where I need to pass mode objects between two controllers. For eg, I have a Login Controller and Customer Controller, If login is success it will redirect to the Customer Controller where the customer details are displayed. When logged in, I need to get the login model objects (which contain login username & password) inorder to get the Customer objects. I tried using @ModelAttribute("login"), but not working.
Posted code snippets below:
But here the login attribute is empty so that I cannot query the Customer object using the id and password
Please Help..! Thanks in Advance..
I got the solution..!!! Spring 3.1 introduces a new feature called 'RedirectAttributes' where we can set our object in one controller (POST) and retrieved in the other controller (GET), which will solve the issue.
Thanks for the reply..