Introduction
In a Java web application, a Servlet receives a request and sends a response back to the browser.
To send a proper response, two things are extremely important:
Setting the response content type
Writing output using PrintWriter
If these are not handled correctly:
This guide explains both concepts step by step, assuming no prior knowledge.