stream file and reload on same response object?How do I save a stream to a file in C#?How do I unload (reload) a Python module?How can I redirect and append both stdout and stderr to a file with Bash?How do I generate a stream from a string?How do I reload .bashrc without logging out and back in?Sort ArrayList of custom Objects by propertyHow do I create a file and write to it in Java?How to avoid Java code in JSP files?Streaming a file from WCF serviceFreeze or make Stable Web-view When I Select Action Bar Back?Prevent Loading/reloading every time

Why would a rational buyer offer to buy with no conditions precedent?

Which European Languages are not Indo-European?

Job Market: should one hide their (young) age?

Writing style before Elements of Style

Is there a context where the expression `a.b::c` makes sense?

Is my plasma cannon concept viable?

How to cut a climbing rope?

What does kpsewhich stand for?

When playing Edgar Markov, what is the definition of a "Vampire spell"?

Non-containing subsets of two sizes

How to politely tell someone they did not hit "reply to all" in an email?

Can I tell a prospective employee that everyone in the team is leaving?

Are there any German nonsense poems (Jabberwocky)?

Beginner looking to learn/master musical theory and instrumental ability. Where should I begin?

Are black holes spherical during merger?

What weight should be given to writers groups critiques?

Replacement stem cap and bolt

The art of clickbait captions

Of strange atmospheres - the survivable but unbreathable

What is the use case for non-breathable waterproof pants?

Can you output map values in visualforce inline using a string key?

Why did the person in charge of a principality not just declare themself king?

Why did Jon Snow do this immoral act if he is so honorable?

Is it legal to meet with potential future employers in the UK, whilst visiting from the USA



stream file and reload on same response object?


How do I save a stream to a file in C#?How do I unload (reload) a Python module?How can I redirect and append both stdout and stderr to a file with Bash?How do I generate a stream from a string?How do I reload .bashrc without logging out and back in?Sort ArrayList of custom Objects by propertyHow do I create a file and write to it in Java?How to avoid Java code in JSP files?Streaming a file from WCF serviceFreeze or make Stable Web-view When I Select Action Bar Back?Prevent Loading/reloading every time






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I have a bit of conundrum with my Java Web Application. I am attempting to generate a PDF report and stream that report back to the browser.



To build the report, I first need the user to enter some information (currently done by some JSP and TAG files that save form data to a bean). This information is validated and used as part of that report building process. I'm not persisting that information (only storing it on the bean (transient), which lives on the form). So, in the action class, I'm receiving my request and I'm building the report and then streaming that byte stream array into my response header.



So far so good - the report pops out in my browser, but since I've already used that response object to stream my report, I can't reload my page (thus my web app never returns control back the browser)!



"OK" I thought...so, I decided to open a new window and then call my action class method.

WRONG thing to do: The bean information on the form gets wiped out by the time my action class method is invoked and my validation fails since I have a bunch of null objects in there.



I'm not sure if my code matters (thus I have not posted it) - I can if it helps, but I think I just need some direction on what I need to do in order to



A) Stream my PDF report back to the browser
B) Reload the page



Any thoughts?



It appears that I cannot use the same response object to both reload the page and stream to response. What is the solution... (head scratch)










share|improve this question




























    0















    I have a bit of conundrum with my Java Web Application. I am attempting to generate a PDF report and stream that report back to the browser.



    To build the report, I first need the user to enter some information (currently done by some JSP and TAG files that save form data to a bean). This information is validated and used as part of that report building process. I'm not persisting that information (only storing it on the bean (transient), which lives on the form). So, in the action class, I'm receiving my request and I'm building the report and then streaming that byte stream array into my response header.



    So far so good - the report pops out in my browser, but since I've already used that response object to stream my report, I can't reload my page (thus my web app never returns control back the browser)!



    "OK" I thought...so, I decided to open a new window and then call my action class method.

    WRONG thing to do: The bean information on the form gets wiped out by the time my action class method is invoked and my validation fails since I have a bunch of null objects in there.



    I'm not sure if my code matters (thus I have not posted it) - I can if it helps, but I think I just need some direction on what I need to do in order to



    A) Stream my PDF report back to the browser
    B) Reload the page



    Any thoughts?



    It appears that I cannot use the same response object to both reload the page and stream to response. What is the solution... (head scratch)










    share|improve this question
























      0












      0








      0








      I have a bit of conundrum with my Java Web Application. I am attempting to generate a PDF report and stream that report back to the browser.



      To build the report, I first need the user to enter some information (currently done by some JSP and TAG files that save form data to a bean). This information is validated and used as part of that report building process. I'm not persisting that information (only storing it on the bean (transient), which lives on the form). So, in the action class, I'm receiving my request and I'm building the report and then streaming that byte stream array into my response header.



      So far so good - the report pops out in my browser, but since I've already used that response object to stream my report, I can't reload my page (thus my web app never returns control back the browser)!



      "OK" I thought...so, I decided to open a new window and then call my action class method.

      WRONG thing to do: The bean information on the form gets wiped out by the time my action class method is invoked and my validation fails since I have a bunch of null objects in there.



      I'm not sure if my code matters (thus I have not posted it) - I can if it helps, but I think I just need some direction on what I need to do in order to



      A) Stream my PDF report back to the browser
      B) Reload the page



      Any thoughts?



      It appears that I cannot use the same response object to both reload the page and stream to response. What is the solution... (head scratch)










      share|improve this question














      I have a bit of conundrum with my Java Web Application. I am attempting to generate a PDF report and stream that report back to the browser.



      To build the report, I first need the user to enter some information (currently done by some JSP and TAG files that save form data to a bean). This information is validated and used as part of that report building process. I'm not persisting that information (only storing it on the bean (transient), which lives on the form). So, in the action class, I'm receiving my request and I'm building the report and then streaming that byte stream array into my response header.



      So far so good - the report pops out in my browser, but since I've already used that response object to stream my report, I can't reload my page (thus my web app never returns control back the browser)!



      "OK" I thought...so, I decided to open a new window and then call my action class method.

      WRONG thing to do: The bean information on the form gets wiped out by the time my action class method is invoked and my validation fails since I have a bunch of null objects in there.



      I'm not sure if my code matters (thus I have not posted it) - I can if it helps, but I think I just need some direction on what I need to do in order to



      A) Stream my PDF report back to the browser
      B) Reload the page



      Any thoughts?



      It appears that I cannot use the same response object to both reload the page and stream to response. What is the solution... (head scratch)







      java stream struts httpresponse reload






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 24 at 0:53









      ivan_dragoivan_drago

      3761525




      3761525






















          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55319787%2fstream-file-and-reload-on-same-response-object%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55319787%2fstream-file-and-reload-on-same-response-object%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript