Using the session object in a servlet

In JSP, session can be used directly, but if you want to use session object to store attributes or other operations in servlet, you need to create a session object first. The code is as follows

HttpSession session = request.getSession();

 can be used directly

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326645397&siteId=291194637