Dhamayanthi Karuppanan wrote:...
1) After I submit for the above code, the same page retains for 5 to 6 seconds and goes to forwarded page and shows message. but thread is not called. I have put logs message, but none of messages are logged, even though 5 to 6 sec of thread sleep. [because Thread.currentThread().sleep(5000); Thread.sleep(1000);] i.e Thread sleep is called from run() only, but my log messages are not logged prior and after to Thread.sleep();
2) If i make Thread.sleep(55000), it takes so much time, but still my thread is not started. I hope Thread.sleep(55000) is container Thread and when i tried to get name of it, it says "AJPRequestHandler-HTTPThreadGroup-3"
...
or anyone please guide me how can i do the following:
As soon as, user clicks on "submit", the page should redirect to " "Thank you, you will receive your report in mail shortly"page and I want to start report processing., what happens when i tried as below
It takes around 2mins to complete the java processing for report and shows the Thanks you message. Is there any way to show the Thanks you message as soon as user clicks on "Submit" and then start java processing for reports.
Steve
Are you saying that if you change the sleep commands in lines 8&9 of the first code snippet that your response takes longer to execute? This indicates that the thread IS being called. If you don't see the Log output then you are likely reviewing the wrong log files.
You would have to flush your response stream before starting the report processing.
Dhamayanthi Karuppanan wrote:
Are you saying that if you change the sleep commands in lines 8&9 of the first code snippet that your response takes longer to execute? This indicates that the thread IS being called. If you don't see the Log output then you are likely reviewing the wrong log files.
Yes, If i change to 55 sec (55000), it takes that much time, but still my report generation is not started. I'm very sure, that I'm checking correct log file. Run() method did not log any of my messages, bt thread sleeps for specified time. really not knowing what happens behind the scene. I'm sure something is wrong, but not knowing what it is.
You would have to flush your response stream before starting the report processing.
I tried flushing my message, but it flushes only after report generation.
Any other ideas?
Steve
them good ole boys were drinking whiskey and rye singin' this'll be the day that I die. Drink tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|