Win a copy of Programming with Types this week in the Angular and TypeScript forum
or The Design of Web APIs in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

proxy servlet for pdf byte serving

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
author & internet detective
Posts: 39760
797
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Christopher Au
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Posts: 39760
797
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 got this tall by not having enough crisco in my diet as a kid. This ad looks like it had plenty of shortening:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!