In what scenarios is it safe to have instance variables in a servlet?
- Always safe
- Never safe
- When shared across sessions
- When thread safety is guaranteed
Instance variables in a servlet are safe when they are shared across sessions and thread safety is guaranteed, ensuring that multiple requests can access them concurrently without issues.
Loading...
Related Quiz
- The method __________ is used to handle request and response objects in a filter.
- In caching strategies, what is meant by 'cache warming'?
- How would a filter log request information without altering the request itself?
- In servlets, the _________ framework can be used for advanced error handling and logging.
- The __________ method is used to initialize the filter with configuration parameters.