Which method is commonly used for session tracking in servlets?
- doGet()
- doPost()
- getSession()
- init()
The getSession() method is commonly used for session tracking in servlets. It returns the current session associated with the request or creates a new session if one does not exist.
Loading...
Related Quiz
- The setMaxAge method sets the _________ of a cookie in seconds.
- The __________ method is used to initialize the filter with configuration parameters.
- To apply multiple filters to a single resource, the web.xml file must define a __________ for each filter.
- In which scenario would you use HttpSessionIdListener?
- To access all initialization parameters, the method ________ can be used, which returns an _________.