i want view pdf file just view dynamically in pop up window using java.while i clicking that file link open a pdf file pop up window its don't allow down load option please help me give some example in java.i need need java code with using action to jsp
File f= new File(file);
if(f.exists()){
ServletOutputStream op= response.getOutputStream();
response.reset();
if(check==1){
response.setContentType("application/pdf");
}else{
response.setContentType(content);
}
// response.setHeader("Content-disposition","attachment; filename=" +fileName);
byte[] buf = new byte[4096];
int length;
DataInputStream in = new DataInputStream(new FileInputStream(f));
while ((in != null) && ((length = in.read(buf)) != -1)){
op.write(buf,0,length);
}
in.close();
op.flush();
op.close();
}