• Post Reply Bookmark Topic Watch Topic
  • New Topic

doget dopost handler

 
Jeff Kish
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
trying to get a handle on understanding servlets.

say there is a doget and dopost method that call a generic
doit(request,response) method.

Suppose the doit(request,response) method just returns if, say a
session.getattribute(ImBusyFlag) is set, and otherwise uses
session.setattribute to
set the flag, do work and then clear it before returning.

What happens to the request if it isn't processed at all. it doesn't get
'lost', does it? or is it up to the requestor/browser to realize it was not
processed and to try again or what?

thanks

Jeff Kish
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jeff Kish:

What happens to the request if it isn't processed at all


What do you mean by this?
 
Jeff Kish
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, if the doit(request,response)

starts executing and finds that it is currently being called, i.e. that
flag is set, and it bails, does that request just get lost that was being processed?

I mean can't some activities that happen as part of processing a request cause another request to be generated, and if that happened can't the newly generated request 'come in' to the handler and get dropped because the flag is set?

maybe this is just to prevent double clicks or something...
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jeff Kish:
and it bails


"bails"?

There's no bail() method in the servlet class. What do you mean by "bail"?

Reagrdless of what you do -- short of a System.exit() -- the method will terminate and the response will be returned to the client.
 
Refer Java
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thnx
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Refer Java",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
Jeff Kish
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, sorry. I thought bail was a short cut for 'bail out' or just leave town or basically, in programming, just return.

I guess then basically the doget handler does not do anything, and the 'empty' response (i.e. no html or anything) goes to the container, and then an empty http response goes back.

I guess when browsers get http responses back that are empty they don't do anything.. that kind of fits the bill with what I think I see.

I appreciate your time.
Jeff
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jeff Kish:
well, sorry. I thought bail was a short cut for 'bail out' or just leave town or basically, in programming, just return.


Attitude not necessary. Imprecise language makes questions difficult to answer precisely.

I guess then basically the doget handler does not do anything, and the 'empty' response (i.e. no html or anything) goes to the container, and then an empty http response goes back.


The response will have no body unless you write something to it. But short of stopping the server, a response will be returned to the client.

I appreciate your time.


My pleasure.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!