wood burning stoves 2.0*
The moose likes Servlets and the fly likes If stop button clicked after submit  , what happned at Servlet side. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "If stop button clicked after submit  , what happned at Servlet side." Watch "If stop button clicked after submit  , what happned at Servlet side." New topic
Author

If stop button clicked after submit , what happned at Servlet side.

Mohan Karthick
Ranch Hand

Joined: Apr 11, 2005
Posts: 199
I have an query that if i clicked on stop just after a while i clikced on submit button which os going to call servlet and processing some database query.
same if I clicked on back button or forward button.

Thanks in Advance.

Mohan
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Yes, all three would break the current connection.
Back and Refresh will start new connections.

On the server side a broken connection exception will be thrown.
You can see this in your container's logs.
[ June 13, 2005: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
In the little server I wrote the error is not detected until all the heavy server processing is done and I start to write the response. Is that true in serious servers as well or have they found a way to kill whatever task the server is running for the user? Hitting refresh a few times while a long-running query is executing can cause a lot of these errors in a hurry!


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
D Rog
Ranch Hand

Joined: Feb 07, 2004
Posts: 472

It's interesting question. I believe servlet should continue sending something to a browser when processing a request and as only IO error happens, it should stop processing and roll back any changes. The trick is that no actual IO exception rosen, so you have to call checkError() to figure out that a browser stopped accepting your stream. I doubt that majority of servlet developers use this technology. Of course it isn't relevant how big and complex servlet container used.


Retire your iPod and start with HD Android music player Kamerton | Minimal J2EE container is here | Light weight full J2EE stack | and build tool | Co-author of "Windows programming in Turbo Pascal"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: If stop button clicked after submit , what happned at Servlet side.