How does a servlet typically report an error back to the client?

  • Print the error on the page
  • Redirect to an error page
  • Send an error code
  • Throw an exception
A servlet typically reports an error back to the client by sending an error code using the sendError() method. This can be accompanied by an error message or a redirection to an error page.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *