• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Request & Response parameters

 
manish ahuja
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Actually this is an interview question. Who creates the request & response parameters that are passed to the service method.

If we have a service as well as doGet method in our servlet which one will be called to cater to the request of the client. Will both be called or no.



Rgrds
Manish
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Actually this is an interview question. Who creates the request & response parameters that are passed to the service method.

The Web Server or the Container.


If we have a service as well as doGet method in our servlet which one will be called to cater to the request of the client. Will both be called or no.

The service will be called anyway. Depends on the method of the form (POST or GET) (by assuming that you havent overrided the service method), the corresponding do method (doGet() or doPost()) will be invoked.

Nick
[ October 04, 2004: Message edited by: Nicholas Cheung ]
 
Alex Sharkoff
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Who creates the request & response parameters that are passed to the service method.


I guess here we are talking of HTTPServletRequest and HTTPServletResponse. Therefore, it is responsibility of a web container to create these objects.


[ October 04, 2004: Message edited by: Alex Sharkoff ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic