2013年9月4日星期三

The Struts2 action execution time is relatively long , resulting innot jump page , how to deal ?

The problem is this : I used to do an excel poi export a small amount of time when the data page will be able to jump over a certain amount of data processing in action inside a long long time , when the action can not be processed after the jump page , page or in the wait state. I mainly want to know why there is such a problem , how to solve . Of course, sql and code optimization first whether , after reprocessing .
------ Solution -------------------------------------- ------
so no good way to it, you export more slowly, because the amount of data you too .
you set a bit and see where the main time-consuming , is in the sql query, or in the poi data when filling .
If you exported data is too large , the memory will overflow .
Or you could consider into several excel file , and then return link , through the link before downloading ~
------ Solution ---------------- ----------------------------
is not it asynchronously it, so kick back full package , and then show the link .
------ Solution ---------------------------------------- ----
ah , the user ajax. successful return before the bomb windows , " being processed ....."
------ Solution --- -----------------------------------------
ajax, like large file uploads
------ Solution ---------------------------------------- ----
this should be a relationship between the bar and the browser .

browser to access a page, there should be a time-out period , the number of seconds after the server is not responding , the browser that overtime , even if later there is a response , and the browser does not handle .
------ Solution ---------------------------------------- ----
can try wireshark packet capture analysis is relatively clear, the premise is you want a little network infrastructure !
------ Solution ---------------------------------------- ----

function now say I do not care whether it is reasonable , just want to know how to solve this problem.  


Well, you can open the asynchronous thread , click generate Excel when the direct return to the page , the background continues to generate . Generate progress monitoring , display the foreground.
full 100 % direct refresh the page. Or you display only tasks generate ing ... and then wait to return. Ajax or what their consideration.
the generated files , temporary folder on the local server , the download path is given , the display page. Achieve click to download.
This prevents the page will hang , no reflect the situation .
idea is , the first page is displayed. Reprocessing . Understand what
------ Solution ------------------------------------- -------
addition, you kind of problem can not be solved. Is a wrong idea . Looks like adjusting the browser waits response time,
and project server response time may be . Specifically I have not come across such a problem, because I do not.
You can not let each user in order to adapt the software you have to adjust the browser , right ? Ignore you, almost do not have to study this problem .
------ Solution ---------------------------------------- ----
directly spread in the past will not do it , why would the pilot out to a local re- download ?
------ For reference only -------------------------------------- -
you jump page and download excel What is the relationship ? After downloading and then jump ? What thinking ~
download process for a long time , and not necessarily related page jump . You open up the thread asynchronous processing download
------ For reference only ------------------------------ ---------

I was in action inside the generated excel on the server , and then return to the page display a download link so not okay ?
------ For reference only -------------------------------------- -

function now say I do not care whether it is reasonable , just want to know how to solve this problem.
------ For reference only -------------------------------------- -

you mean direct response do ? If the data is large, then does not work , the page still stuck.
------ For reference only -------------------------------------- -
I encountered the same problem, I was doing the import feature , the background , the foreground show progress ; background execution after the return to the page , and report the results . Now encountering is that there are insufficient data in the case , you can return to the page at normal messaging, data and more ( more than one thousand or so ) in the case , the preceding page will always stay in the execution of the state , unable to re- load a new page. Will grabbed what was later found the reason ?
Another: I test locally without this phenomenon, the publisher only after

没有评论:

发表评论