The content type is a way for the server to communicate with the browser about the type of data being sent.
HelloServlet: I used .setContextType( ) method to specify the type of content that the browser should expect to receive. Alternatively, @RequestMapping could be used. For the types of the context:
- "text/plain" for plain text content
- "application/json" for JSON data
- "image/jpeg" for JPEG images