Sending Binary (Non-Text) Information to Clients
By sending raw bytes instead of characters, a servlet can provide any form of digital content, such as images.
Use
getOutputStream()
instead of
getWriter()
.
Must set appropriate MIME type.