• Post Reply Bookmark Topic Watch Topic
  • New Topic

Opening ppt in a new window using jsp

 
Anjana Ravindran
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a requirement where I have to open a PPT in a new window. On clicking a link, I have to open a PPT in a new window. I have coded it in such a way that on click of that link, I am calling an action class. When I run this access from Windows 2000 machine a PPT is opened in a new window. But in Windows XP machine, it is opening in the same window. Donno why. I have set the content type for response properly only. Can you help?

Heres the code for your reference.

String filePath = "C:\\Tomcat 5.0\\webapps\\cscard\\files\\Scorecard Assign Manager Matrix.ppt";
sessionId = session.getId();
servletOutputStream = response.getOutputStream();
System.out.println(filePath);
response.setHeader("Content-Disposition","attachment; filename="+filePath);
response.setContentType("application/vnd.ms-powerpoint");
fileInputStream = new FileInputStream(filePath);
bip = new BufferedInputStream(fileInputStream);

do{
i=bip.read();
if(i!=-1){
servletOutputStream.write(i);
}
}while(i!=-1);
servletOutputStream.flush();
servletOutputStream.close();
fileInputStream.close();

Regards,
Anjana
 
Scheepers de Bruin
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried:

<a href="blabla.jsp" target="_blank">
[ October 26, 2005: Message edited by: Scheepers de Bruin ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!