• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How Web container handle Request and response

 
bikasit babu
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if i am wrong at any of the point just make me correct.as i am new to this servlet section.
what i know about servlet up to this point is the web container while get /sees a request from the client .It creates two objects HTTP request Object(1) and HTTP response Object(2).
Then it creates a thread to the servlet and pass the request object .According to the URL it sees the GET method or POST method then call from service method.
After the Request has been handled the response stored in response Object . the container created thread dies . the response stored in response Object send back to the clients.by making it as HTTP response Object.


I don't know what i understood is correct or not if correct a question arise is when it send the HTTP request and when it send simple request. same about response.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to the URL it sees the GET method or POST method then call from service method.

The URL does not specify the HTTP method. It is specified in the request header.
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4518
280
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bikasit babu wrote:Then it creates a thread to the servlet and............ the container created thread dies .

Not always. Creating threads is a process-intensive task and it would exhaust the container if it attempts to create thousands of concurrent threads for handling thousands of simultaneous requests. Most of the containers avoid this problem by reusing the threads in thread pools, so a thread that has served a request may remain active for servicing another thread.
 
G krishna kumar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
According to the URL it sees the GET method or POST method then call from service method.

The URL does not specify the HTTP method. It is specified in the request header.


it should be from initial request line, from which it get the method information.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic