0

I have two servers. Server-webapplication-1 builed by primefaces+liferay, Server-2 builed spring-boot rest API, the server-2 to do something and return a pdf file (i was referred link https://www.technicalkeeda.com/spring-tutorials/download-pdf-file-using-spring-mvc-rest-controller). In web-application, i have a p:commandLink onclick will get PDF file from server-2 and pass the PDF file to server-webapplication-1. If the PDF file is small (<10Mb), i cant encode to base64 and pass it (How to pass a blob created in javascript to JSF bean). If the PDF file is big, i don't know how to do that because java-exception will be throught (java heap space).
So, how to pass a big file to jsf bean from javascript?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • 2
    Same way you pass a small file... and why do you need to use javascript on a server to upload to a jsf bean om another server? Just do a plain http multipart post instead of trying to abuse technologies – Kukeltje Aug 29 '19 at 06:09
  • @Kukeltje My web application require a feature get file from scanner machine an push PDF file to alfresco server (this server is private network, only one `Server-webapplication-1` have permission to connect to that) on click a link in browser . Therefore i was created `server-2` (this server will be run on client machine) for read scanner machine and return PDF file. If the file is big, base64 decode will be through a java exception `java.lang.OutOfMemoryError: Java heap space`. – Trương Huy Aug 29 '19 at 09:19
  • Your comment does not make it any clearer... But regarding the OOM: increase your memory or do it streaming... Try to use more words in your question, more structure, more explanation on what server is doing what (where is the scanner connected to). Where is the oom occuring etc... I'm inclined to https://idownvotedbecau.se/unclearquestion and http://idownvotedbecau.se/nomcve/ since it takes too much time to get things clear... – Kukeltje Aug 29 '19 at 09:52

0 Answers0