last day (16 days later) » 

10:43 AM
@Neil Sorry ya, I am not finding anyone who can help me on java and it's a bit urgent.
 
 
5 hours later…
4:01 PM
@Appu Sorry myself. To say I've been busy today would be an understatement of the year
 
4:17 PM
@Neil Oh, seems you are loaded with lot of work. are you still busy?
 
@Appu Nah, not for the rest of today
But I will be leaving shortly
Is it something I can help you with within the next 10 minutes?
 
@Neil I have a form submission which submits to the servlet. In the servlet the data is loaded from the database and loads into collection object. I used forward method and passing that loaded collection object to the jsp and then I am showing the data in jsp.
The thing is the queries used to get the data take too much time(say 3-4 mins). So, I just want to show ajax text(Data is loading..) here. I am confused where to show and how to go further.
 
@Appu The client puts up a loading message when the ajax request is sent
Until the ajax response comes, you don't do anything on the client
If the response comes, (also in the case of error), you remove loading message
If the request times out, then you'll have to specify an additional http header parameter which prevents your request from prematurely finishing in error
 
@Neil The thing is I am showing data entirely on different page which is jsp as I said above. But the form is submitting to servlet.
How to start it when the servlet execution starts? And most importantly on the result page
 
The jsp should be directly calling the servlet (since you're on the server, you don't need to make ajax call)
In other words, the jsp shouldn't finish execution (in other words asynchronously) until you have everything you need to send back
If that is not your case, then the client submitting to the jsp will immediately receive a response, which is not waht you want to do
Generally you submit directly to the servlet, not to a jsp
The servlet can hold the logic that the jsp holds
When you configure the servlet, you specify the relative URI to access it, so for example /myServlet
When you make the ajax call, you retrieve the response from /myServlet
And the servlet will receive the request directly
 
4:34 PM
@Neil Yes, but the response is shown by using jsp.
 
The client should either be making an ajax call or it should be submitting a form
If you're using an ajax call, whatever the jsp returns will be the data returned in the ajax call (to use however you wish)
If you submit a form, what the jsp returns will be the new page your browser will navigate to
In the latter case, you can show a loading message and then simply wait
 
@Neil Yes, that's what the problem is, how to show that loading text on the new page
 
When the jsp returns, your browser will change pages.. you don't need to know when that happens because it will happen on its own
Now, if you're doing something on the new page returned in the jsp, treat it no differently than any other page
It will have its own ajax or form call
If taht's what you want to do
I got to run, sorry. I hope that clarifies things
 
@Neil Okay, cya. But I am confused ;/ please ping me tomorrow if you have time.
 

  last day (16 days later) »