For an application that needs to authenticate users based on roles, what is the best approach to implement this in servlets?
- Container-Managed Security
- Custom Authentication Logic
- Database Authentication
- SSL Authentication
The best approach for implementing user authentication based on roles in servlets is to use Container-Managed Security, which is configured in the deployment descriptor (web.xml) and utilizes the container's security mechanisms.
Loading...
Related Quiz
- When optimizing memory usage in a Java application, what strategies should be considered?
- How can you retrieve a servlet's initialization parameters in the init method?
- To pass the request and response to the next entity in the chain, the filter uses the __________ method.
- _________ encoding is a common technique to prevent XSS by converting special characters into HTML entities.
- Which of the following is a recommended approach to handle database connections in servlets?