我无法理解这 3 种设置属性的方式之间的区别:
// String as attribute of request
req.setAttribute("name", "Sluggo");
// Integer as attribute of session
req.getSession().setAttribute("age", 10);
// Date as attribute of context
getServletContext().setAttribute("today", new Date());
- 有什么区别?
- 你应该什么时候使用每个?