If you can open the PDF file with your browser (that is the PDF file has
some URL like http://localhost/mydir/aaa.pdf ), you can use <%
response.sendRedirect("http://localhost/mydir/aaa.pdf";); %>

 If the PDF file is in the *same web application* with the JSP page, you can
use <jsp:forward> to return the content of the PDF file (the JSP page will
read and return the content of the PDF file to the web browser)

 Otherwise, you must can't use JSP pages to to that! But you can use
servlets to do that

 Regards
 Thai

-----Original Message-----
From: EJB ForAll [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 6:54 PM
To: [EMAIL PROTECTED]
Subject: Re: Using JSP to redirect to a PDF file located outside the web
document root


Hi


You can use the following code.

<%
getServletConfig().getServletContext().getRequestDispatcher("abc.pdf").forwa
rd(request,response);

%>

Hope it will help you.

Regards
Deepak
http://www.geocities.com/deepak_38



--- Bernard Gaughran <[EMAIL PROTECTED]> wrote:
> I would like to use a JSP file to redirect a user's
> browser to a PDF file located OUTSIDE the web
> document
> root on the same machine.
>
> How do I use JSP to do this?
>
> Regards
> Bernard Gaughran
>
>
>
____________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.co.uk address at
> http://mail.yahoo.co.uk
> or your free @yahoo.ie address at
> http://mail.yahoo.ie
>
>
===========================================================================
> 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://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.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://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
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://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to