Opening a PDF file from a Servlet

I have a PDF file which I want to render to my client.

Once the request come how can read the file from underlying O/S like c:/temp/a.pdf and then render him back ...

Thanx in advance,

RK
rahulkothariAsked:
Who is Participating?
 
CEHJCommented:
You need to set the right mime type for the response. See

http://www.javaworld.com/javaworld/javatips/jw-javatip94.html
0
 
rahulkothariAuthor Commented:
how about using HttpClient ... let know your views ...

RK
0
 
CEHJCommented:
Is the client a browser? If it isn't, you're going to have to find either something to plug in to your gui, or run something like Adobe to view it
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
CEHJCommented:
(HttpClient is non-gui software)
0
 
objectsCommented:
You can use Runtime.exec() to invoke a PDF viewer. Try command something like:

cmd /c start c:\temp\a.pdf
0
 
CEHJCommented:
:-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.