• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpServletResponse

 
Abu Nene
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi is it possible to implement a servlet which generate no reponse? Please advise.
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • 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.
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • 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.
 
Max Rahder
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • 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.
 
Zandis Murāns
Ranch Hand
Posts: 174
Java Java ME Opera
  • Mark post as helpful
  • send pies
  • 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"...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"ABu NeNe", please check your private messages for an important administrative matter.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic