• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

HttpServletResponse

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi is it possible to implement a servlet which generate no reponse? Please advise.
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. May be if your servlet is delegating to another part of the application to handle the response back to the client. However, if that is not the case, I am not sure why you want to have a servlet that does not send any response back to the client.
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Besides, why would you want to ? The whole idea of servlet interaction is that the client sends a request and gets a response.
 
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ABu NeNe wrote:Hi is it possible to implement a servlet which generate no reponse? Please advise.



I'd say the answer is "no" -- your doGet() or doPost() method is called with request and response objects. You are free to ignore those objects, but the response is still sent back to the user. It's true you can call other methods, passing the request and response, and the other routines can change their states, but ultimately the response originating in the doGet() or doPost() is sent to the client.
 
Ranch Hand
Posts: 174
Java ME Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is "no http response" in your understanding? You can sleep your thread until requester will get time out on that request, if you call this "no response"...
 
Sheriff
Posts: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"ABu NeNe", please check your private messages for an important administrative matter.
 
If you look closely at this tiny ad, you will see five bicycles and a naked woman:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic