I am working for application where i have to send one object per request.And i have to store the whole data in a session variable.How can i do that? I am sending the data into controller and creating the object and then trying to store in a session ,but it is not working and this is my code
MemberDependentBO memberdepinfo = new MemberDependentBO();
memberdepinfo.setFirstName(getMemberFirstName().getValue().toString());
memberdepinfo.setLastName(getMemberLastName().getValue().toString());
memberdepinfo.setMiddleName(getMemberMiddleName().getValue().toString());
memberdepinfo.setPassport(getMemberPassportNumber().getValue().toString());
List<MemberDependentBO> listOfMemberAndDep = new ArrayList<MemberDependentBO>();
listOfMemberAndDep.add(memberdepinfo);
httpSession.setAttribute("insuredInfo", listOfMemberAndDep);
System.out.println("List Size :"+listOfMemberAndDep.size());
Every time when i click the button,the object is coming from the controller .but each time i am getting the size of the list is 1.Any Help will be appreciated