我有以下配置 web.xml
<security-constraint>
<display-name>Login Security Constraint</display-name>
<web-resource-collection>
<web-resource-name>Login Protection</web-resource-name>
<url-pattern>/servlet/*</url-pattern>
<http-method>DELETE</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>Login Access</role-name>
</auth-constraint>
</security-constraint>
我有我自己的登录 servlet,我已经对用户进行了身份验证并使用它创建了一个会话
HttpSession session = request.getSession(true);
但是如何将角色名称“登录访问”添加到会话中?