在他登录系统后,我应该使用哪一个为用户创建新会话
req.getSession().invalidate();
req.getSession(true).setAttribute(“user”, user);
或
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Pepole>
<PersonList>
<Person>
<Name>aa</Name>
<Surname>asdf</Surname>
<City>asdf</City>
</Person>
</PersonList>
<PersonList>
<Person>
<Name>aa</Name>
<Surname>dafsd</Surname>
<City>dafdsa</City>
</Person>
</PersonList>
<PersonList>
<Person>
<Name>asdf</Name>
<Surname>asdfasdf</Surname>
<City>asdfadsf</City>
</Person>
<Person>
<Name>asdfsadf</Name>
<Surname>Dasfdasdf</Surname>
<City>asdfdsaf</City>
</Person>
<Person>
<Name>asdfdsaf</Name>
<Surname>asdfdsaf</Surname>
<City>asdfdsaf</City>
</Person>
</PersonList>
</Pepole>
修改
第一个将用户与第一个请求中服务器给出的会话相关联,第二个创建一个全新的