Forums Register Login

flush.buffer

+Pie Number of slices to send: Send
Hi

i have one requirment

I have one jsp page which has one button. now when you click that button it will call another JSP page which will call a function ( which is defined in a class)

now this function writefile will write my output to an excell sheet.

i collect the output in <html> and then use
out.print(buffer.toString())





now the problem is that .
when i click the button for the first time the excell sheet is not loaded , but if i click again the excell sheet will be laoded

now i thought flush.buffer will do my work

but can you tell me where should i write this
flush.buffer line

1)After my out.print(buffer.toString()) line in the function writefile
eg
public void writefile1(HttpServletResponse response, JspWriter out)throws IOException, DfException

buffer.append("</Table></body></html>");
out.print(buffer.toString());
response.flushBuffer();

-----------------------------------------------------------------


or in the JSP page
<%

SearchEx s = new SearchEx();
s.writefile1(response,out);
response.flushBuffer();

%>
+Pie Number of slices to send: Send
I'm not sure why you're going through the process of writing to disk and then reading it back. If you don't need to and just want to stream the HTML and have it opened in Excel, there is a page in the JSP FAQ that shows how to do this.
All of the following truths are shameless lies. But what about this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1043 times.
Similar Threads
AJAX : How can I set response type other than 200 ("OK") in Server Response
AJAX ( problem while retrieving xml data from the jsp)
opeing excell sheet in new window
How to call a class in yr jsp page
problem in passing parameters
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:11:04.