Hi ,
Im sure that u realise that there is no live state maintained thru HTTP and that the servlet after it has delivered the response has nothing to do with the browser .So any further processing u need to do has to be essentially a new request and a new cycle for the Servlet .
And as far as catching the stop button click of the browser , the HTTP server just terminates the request with the browser and the servlet also dies without a call to destroy .
Im not sure if this can help you .
By the way ,just a little curious,whats the need to catch the stop button click of the browser ?
Hi thanx for the interest.
In my appl. I generate xml file with the same name everytime for a perticular query. if a query result is too big it takes more time obv. in between if user hits stop button and does another query (same) still first query writes data in the xml and second quaery appends or writes data in the same xml which gives mismatched tags error.
What i was thinking , if i could trap stop button, i could do somthing bout the xml file being written .
If you have any other suggestion pls advise accordingly.
thnaks again
Sachin
Let me ask you another problem i am facing.
while displaying the result xml page in the browser. it shows the old xml contents though new query has been done. I have to press the refresh button every time after a new query.
Somebody suggested me to use some meta tag in my html but i am not able to find the tags . If you know something bout this, could you pls let me know?
thanks
Sachin
Hi ,
Are u using the FileOutputStream for writing into the xml file .If so u can use the constructor with false as the boolean-FileOutputStream(String filename,boolean fasle)
This way the file contents are overwritten every time.Also make sure that the FileOutputStream object is created for each user request and is not static .
Another way would be to use the File.exists() and file.delete before calling the FileOutputStream object.So this way u are always starting with a new file.
Hope it helps
> Let me ask you another problem i am facing.
> while displaying the result xml page in the browser.
> it shows the old xml contents though new query has
> been done. I have to press the refresh button every
> time after a new query.
> Somebody suggested me to use some meta tag in my html
> but i am not able to find the tags . If you know
> something bout this, could you pls let me know?
>
> thanks
> Sachin
Hi ,
Can u explain this a little further?
Thanks, I will try that first solution.
Second problem is autoreloading the page in browser. Browser doesn't load the new page created, it shows the old page instead. since i use the same name for the page . like if i give url http:/.../../s.html (s.html is dynamically generated thr' servlet) . if i go back and again load s.html (now it is changed) but still it appears as the old s.html. When i press refresh button of browser then it displays the right one(changed new one).
I know it takes the page which is in cache of the browser. I tried all possible combination of html tags like
<meta http-equiv="Refresh" content="text/html; charset=windows-1252"> in html.
and response header in servlet like
response.setContentType("text/html");
response.setHeader( "Pragma", "No-cache" );
response.setHeader( "Cache-Control", "No-cache" );
response.flushBuffer();
response.setDateHeader( "Expires", 0 );
but in vain.
I hope u get this.
thanks
Sachin