*
The moose likes Servlets and the fly likes proxy servlet for pdf byte serving Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "proxy servlet for pdf byte serving" Watch "proxy servlet for pdf byte serving" New topic
Author

proxy servlet for pdf byte serving

Christopher Au
Greenhorn

Joined: Jul 26, 2007
Posts: 21
Hi,

I have the following situation. There is a pdf streaming servlet provided by a vendor which not accessible to the outside world as the data is sensitive. What we would like to is write a proxy servlet which can pass the pdf streams back to the browser, the reason for this proxy servlet is to do some authorization to ensure that the person who is logged does indeed have access to the PDFs. If anyone could offer some example code that would be greatly appreciated.

Thanks

Lasher
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30392
    
150

Do you have to pass the PDF stream? I think it is easier to get the whole PDF file and then open a new stream to the real client.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Christopher Au
Greenhorn

Joined: Jul 26, 2007
Posts: 21
Hi,

would it not be faster if we were to take this approach, otherwise we will need to wait for the file to come through completely (this will be byte served to us) and then we will then need to byte serve the pdf to the browser.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30392
    
150

Streaming is faster. If the file isn't very large, it wouldn't be noticeable though. I'm not sure how to do the real time streaming. Somewhat curious if it is possible now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: proxy servlet for pdf byte serving