As specified below I am trying to open the pdf Document by using servile, in my
code i am setting the Mime type - application/pdf.
Here i am sending my code, Please take a look and suggest me for the best
possibility.
public void service(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res)
throws javax.servlet.ServletException, java.io.IOException
{
HttpServletResponse hResponse = (HttpServletResponse) res; // Creating the
responce object.
String sMimetype = "application/pdf";
hResponse.setContentType(sMimetype);
hResponse.setStatus(hResponse.SC_OK);
OutputStream out = hResponse.getOutputStream();
byte[] bOutput = (byte[])agaDataDoc.getProperty("doccon"); // Reading the
document content from the database and costing into byte array.
out.write(bOutput);
}