Hello every one I have a register jsp and I need to send two object(Compte,Personne) please there is any way to send the two to the controller
Asked
Active
Viewed 565 times
-2
-
Take a look at this: http://stackoverflow.com/questions/13242394/spring-mvc-multiple-modelattribute-on-the-same-form – Rana_S Nov 22 '15 at 16:33
-
You take the different attributes from your request and dispatch them to the correct objects. To send them via the request, you use a form for the post method or the url for the get method... – Yassin Hajaj Nov 22 '15 at 16:34
-
please can you make an example with jsp and post mehod thank you – user0321 Nov 22 '15 at 16:36
1 Answers
0
You can put your objects: Compte
and Personne
into: Map<String, Object> objectsMap = new HashMap();
. Then in your controller get them by key: objectsMap.get("personne");
Also, try to use Spring Forms and receive object via @ModelAttribute
.

Vlad Krava
- 34
- 4