javaWeb four domain objects
1) Methods related to attributes
Object getAttribute(String name) | Get the specified attribute |
Enumeration getAttributeNames() | Get the Enumeration object composed of the names of all attributes |
void removeAttribute(String name) | Remove the specified attribute |
void setAttribute(String name, Object o) | Set properties |
2) Domain objects containing the above attribute methods
pageContext, request, session, application scope range from small to large
pageContext | The scope of the property is limited to the current jsp page, and the object cannot be obtained in the servlet |
request | The scope of the property is limited to the same request, mainly used for request forwarding |
session | The scope of the property is limited to one session, which is called a session from the browser opening until it is closed (during this period the session does not expire), and is obtained through the request object in the servlet. |
Application | The scope of the property is limited to the current WEB application and is the largest scope of the property. As long as the property is set in one place, it can be obtained in jsp or servlets everywhere, corresponding to the ServletContext object in the servlet. |
Thank you for reading, I hope it can help you. Thank you for your support for this site!