AddAllAttributes method spring mvc

Posted by Nick Robertson on Stack Overflow See other posts from Stack Overflow or by Nick Robertson
Published on 2012-06-02T22:30:56Z Indexed on 2012/06/02 22:41 UTC
Read the original article Hit count: 235

Filed under:
|
|

I have two lists

List<User> list_of_users=new ArrayList<User>();
List<String> list_of_attributes=new ArrayList<String>();

When i try to use the following lines of code:

model.addAttribute("takeattributes",list_of_users);
model.addAttribute("takeattributes",list_of_attributes);

I realise that it keeps only the second list (list_of_attributes) and the first deleted. I was wondering how to keep both of these two lists in the model.Is this possible to be happened?Is the AddAllAttributes method what i need?If yes can anyone explain me how the AddAllAttributes method is working.I look at the spring mvc documentation but i didn't really understand.

© Stack Overflow or respective owner

Related posts about java

Related posts about spring