How does a servlet differentiate between GET and POST requests?
- By request headers
- By session cookies
- By the request URL
- By the request body
A servlet differentiates between GET and POST requests by examining the request body. GET requests append data to the URL, while POST requests send data in the request body.
Loading...
Related Quiz
- Servlets can use the _________ interface to log application-level events.
- When implementing a servlet to handle form data from a dynamically generated form with varying field names, what strategy should be employed?
- In a servlet, how can you retrieve parameters sent via the POST method?
- How would a servlet handle different initialization parameters for different deployment environments?
- What is the best practice for handling sensitive data in servlet log files?