• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Interruption in servlets

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
when the servlet is executing half the way through, if am clicking the stop button in the browser what will happen inside the servlet and in the server. Which will handle this scenario a servlet or a server.
if i want to handle in my servlet, what should i do then?
regards
sri
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The event is not sent down to the server. The browser just stops. While the thread is still busy processing.
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The sequence of action is:
1. User (browser) sends a URI request to the server. Browser waits for results. The STOP button is enabled.
2. Server decodes URI and determines the action to take. For an HTML page, this is just a matter of locating the file that corresponds to that URL and copying its contents back to the client. For servlets, the servlet dispatcher locates the appropriate servlet and passes the request to that servlet.
3. Servlet executes. Output is placed on the return output stream and transmitted back to the client.
4. When all data has been received, the client displays it (often this is done on-the-fly) and the browser unlocks for another request (the STOP button is disabled).
If you click the STOP button, it unlocks the browser and causes the returning data from the servlet to be discarded. However, if you look at the servlet API, you'll notice that there's no such thing as an HTTP STOP request handler. It is a totally non-interactive process. Once the servlet starts, it's going to run to completion.
 
Not looking good. I think this might be the end. Wait! Is that a tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic