enzo
enzo

Reputation: 267

HttpServlet contracts for doGet and doPost

Is there any contract of request processing for doPost and doGet methods(except that doGet is idempotent and doPost is not) for the servlet class which extends javax.servlet.http.HttpServlet. Is it ok to send nothing in response or it's mandatory to do forward or write something in response?

Upvotes: 1

Views: 93

Answers (1)

Testo Testini
Testo Testini

Reputation: 2240

Is not mandatory to write to response, however you might consider to send an HTTP Status 204 No Content in that case.

Upvotes: 1

Related Questions