Hi there,
no the issue is not to do with links ...
I have the following jsp code but it's not working :
 
<%@ page import = "java.io.*, java.util.* " contentType="application/pdf" %>
 
 
<%
System.err.println("Comienza la ejecución.");
    String name = "C://temp/EAPAdminGuide.pdf";
    
    try
    {
      // read file
    
      InputStream in = new FileInputStream(name);
      
      int BUFFER_SIZE = 3331584; 
      byte[] buffer = new byte[BUFFER_SIZE];
      int n = 0;
      while( (n=in.read(buffer)) > 0)  
      {
      
      } 
      in.close();
      
    // send file
      response.reset();
      response.setContentType("application/pdf");
      response.getOutputStream().write(buffer,n,BUFFER_SIZE);
      response.getOutputStream().flush();
    }
    catch(Exception e)
    {
      out.print(e.getMessage());
    }
    
    System.err.println("Finaliza la ejecución.");
 
%>

Did u come across this before?
Thanks
-----Original Message-----
From: Gare, Trefor [mailto:[EMAIL PROTECTED]]
Sent: 25 January 2002 00:17
To: [EMAIL PROTECTED]
Subject: Re: Loading pdf files using jsp


Might need more info to help here.
I'm assuming you're not just wanting to link to a PDF, but just in case...

To link to a pdf file from a webpage (of any flavour ie: html, jsp, php etc)

<a href="/myPdfs/thisisit.pdf">click for pdf</a>

The behaviour of the resulting link varies from browser to browser

If this doesn't help, let me know a bit more about what you're after and
I'll see if I can help.



Tref Gare
Web Developer MCSD/SCJP
eCommerce Group
Phone:  (03) 9221 4106
Mobile: 0409 556 478
Fax:    (03) 9941 4295

> -----Original Message-----
> From: Shahata, Ashraf [SMTP:[EMAIL PROTECTED]]
> Sent: Friday,25 January 2002 10:17
> To:   [EMAIL PROTECTED]
> Subject:      Loading pdf files using jsp
>
> Hi all,
> does anyone know of any examples for loading pdf files in jsp?
>
> Thanks
> Ash

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

==========================================================================To 
unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to