How can I show various kind of documents to a web client from JSP's and/or servlets?

You can show MS Word, Excel or PDF or any other type of document through your JSP or servlet by using :

response.setContentType("mime/type");   and

in jsp directive 

<%@ page contentType="mime/type" %>.

In case of MS Word documents contentType is "application/msword"
In case of Excel it is "application/"
In case of PDF it is "application/pdf"



Interview Questions On Java,Java EE Copyright © 2018. Reads: best tracker